Contribute language association from extensions in VSCodeHow can I write a vsc snippets extension for a language that is not listed on visual studio codeDisable wordBasedSuggestions from an ExtensionHow do you format code in Visual Studio Code (VSCode)Multiline editing in VSCodeHow to switch word wrap on and off in VSCode?don't know where to get data from vsCode autocomplete listShow HTML5 <video> on previewHtml command in vscode extensionVSCode Extension REST calls not workingImplementing a Preview channel of a vscode extensionIs vscode-python extension for VSCode is a Language Service or just an extension only?Does VSCode API allow an extension to provide custom logic for merging results returned by multiple extensions for the same language?How to use built-in Javascript extension to automatically find symbols in a JS file when developing a custom extension?
How to denote matrix elements succinctly?
Which big number is bigger?
Can I criticise the more senior developers around me for not writing clean code?
How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?
How can I print the prosodic symbols in LaTeX?
"Hidden" theta-term in Hamiltonian formulation of Yang-Mills theory
Overlay of two functions leaves gaps
How can I practically buy stocks?
Checks user level and limit the data before saving it to mongoDB
Extension of 2-adic valuation to the real numbers
As an international instructor, should I openly talk about my accent?
Function pointer with named arguments?
How do I reattach a shelf to the wall when it ripped out of the wall?
Who was the lone kid in the line of people at the lake at the end of Avengers: Endgame?
Can SQL Server create collisions in system generated constraint names?
Is there any official lore on the Far Realm?
Mistake in years of experience in resume?
bldc motor, esc and battery draw, nominal vs peak
A Note on N!
Was there a shared-world project before "Thieves World"?
Check if a string is entirely made of the same substring
What is the smallest unit of eos?
Two field separators (colon and space) in awk
What makes accurate emulation of old systems a difficult task?
Contribute language association from extensions in VSCode
How can I write a vsc snippets extension for a language that is not listed on visual studio codeDisable wordBasedSuggestions from an ExtensionHow do you format code in Visual Studio Code (VSCode)Multiline editing in VSCodeHow to switch word wrap on and off in VSCode?don't know where to get data from vsCode autocomplete listShow HTML5 <video> on previewHtml command in vscode extensionVSCode Extension REST calls not workingImplementing a Preview channel of a vscode extensionIs vscode-python extension for VSCode is a Language Service or just an extension only?Does VSCode API allow an extension to provide custom logic for merging results returned by multiple extensions for the same language?How to use built-in Javascript extension to automatically find symbols in a JS file when developing a custom extension?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
How can I contribute a language association from an extension in VSCode?
In settings.json it would've looked like this:
"files.associations":
"*.something": "markdown"
I know that it's possible to use vscode.languages.setTextDocumentLanguage. But that seems excessive to do every time the activeEditor changes, and it's one more event listener.
Using the API to write into user settings doesn't seem right either.
visual-studio-code vscode-extensions
add a comment |
How can I contribute a language association from an extension in VSCode?
In settings.json it would've looked like this:
"files.associations":
"*.something": "markdown"
I know that it's possible to use vscode.languages.setTextDocumentLanguage. But that seems excessive to do every time the activeEditor changes, and it's one more event listener.
Using the API to write into user settings doesn't seem right either.
visual-studio-code vscode-extensions
add a comment |
How can I contribute a language association from an extension in VSCode?
In settings.json it would've looked like this:
"files.associations":
"*.something": "markdown"
I know that it's possible to use vscode.languages.setTextDocumentLanguage. But that seems excessive to do every time the activeEditor changes, and it's one more event listener.
Using the API to write into user settings doesn't seem right either.
visual-studio-code vscode-extensions
How can I contribute a language association from an extension in VSCode?
In settings.json it would've looked like this:
"files.associations":
"*.something": "markdown"
I know that it's possible to use vscode.languages.setTextDocumentLanguage. But that seems excessive to do every time the activeEditor changes, and it's one more event listener.
Using the API to write into user settings doesn't seem right either.
visual-studio-code vscode-extensions
visual-studio-code vscode-extensions
edited Apr 14 at 16:14
Gama11
13.2k52652
13.2k52652
asked Mar 9 at 8:57
AlexAlex
13.9k44764
13.9k44764
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Yes, extensions can contribute settings via configurationDefaults. However, I don't think this works for the files.associations setting.
What you can do instead is contribute a new file extension for the markdown language:
"contributes":
"languages": [
"id": "markdown",
"extensions": [
"something"
]
]
This won't replace the previous registration of the markdown language, instead it will be merged with it.
add a comment |
Make the following change to your package.json, I figured it out by studying an existing extension.
You must add . before something
Also see :
How can I write a vsc snippets extension for a language that is not listed on visual studio code
"contributes":
"languages": [
"id": "markdown",
"extensions": [
".something"
],
]
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075628%2fcontribute-language-association-from-extensions-in-vscode%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Yes, extensions can contribute settings via configurationDefaults. However, I don't think this works for the files.associations setting.
What you can do instead is contribute a new file extension for the markdown language:
"contributes":
"languages": [
"id": "markdown",
"extensions": [
"something"
]
]
This won't replace the previous registration of the markdown language, instead it will be merged with it.
add a comment |
Yes, extensions can contribute settings via configurationDefaults. However, I don't think this works for the files.associations setting.
What you can do instead is contribute a new file extension for the markdown language:
"contributes":
"languages": [
"id": "markdown",
"extensions": [
"something"
]
]
This won't replace the previous registration of the markdown language, instead it will be merged with it.
add a comment |
Yes, extensions can contribute settings via configurationDefaults. However, I don't think this works for the files.associations setting.
What you can do instead is contribute a new file extension for the markdown language:
"contributes":
"languages": [
"id": "markdown",
"extensions": [
"something"
]
]
This won't replace the previous registration of the markdown language, instead it will be merged with it.
Yes, extensions can contribute settings via configurationDefaults. However, I don't think this works for the files.associations setting.
What you can do instead is contribute a new file extension for the markdown language:
"contributes":
"languages": [
"id": "markdown",
"extensions": [
"something"
]
]
This won't replace the previous registration of the markdown language, instead it will be merged with it.
answered Mar 9 at 9:45
Gama11Gama11
13.2k52652
13.2k52652
add a comment |
add a comment |
Make the following change to your package.json, I figured it out by studying an existing extension.
You must add . before something
Also see :
How can I write a vsc snippets extension for a language that is not listed on visual studio code
"contributes":
"languages": [
"id": "markdown",
"extensions": [
".something"
],
]
add a comment |
Make the following change to your package.json, I figured it out by studying an existing extension.
You must add . before something
Also see :
How can I write a vsc snippets extension for a language that is not listed on visual studio code
"contributes":
"languages": [
"id": "markdown",
"extensions": [
".something"
],
]
add a comment |
Make the following change to your package.json, I figured it out by studying an existing extension.
You must add . before something
Also see :
How can I write a vsc snippets extension for a language that is not listed on visual studio code
"contributes":
"languages": [
"id": "markdown",
"extensions": [
".something"
],
]
Make the following change to your package.json, I figured it out by studying an existing extension.
You must add . before something
Also see :
How can I write a vsc snippets extension for a language that is not listed on visual studio code
"contributes":
"languages": [
"id": "markdown",
"extensions": [
".something"
],
]
answered Apr 14 at 16:30
Xiaoou WangXiaoou Wang
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075628%2fcontribute-language-association-from-extensions-in-vscode%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown