-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger language auto detection mechanism #11838
Comments
See Changing language for current file Please ask 'how-to' questions about VS Code on Stack Overflow using the tag |
@ramya-rao-a ?????? |
My point is that - it seems that |
Sorry, I thought you were talking from a user's perspective rather than an extension author. Will look into it and get back to you |
@XVincentX This mostly depends on the filename and 'pasting it into the editor' will miss that information I guess. |
@jrieken Thanks! |
Hi, I am faced with a similar problem/scenario as the original poster. Let's say you're faced with this scenario:
Is it this possible, or is it at least something in the pipeline? From an implementation point of view, I would do:
This is quite crude, but I hope that gets the point across. Regardless +1 for this feature. |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
@jrieken is the idea to provide new API vscode/src/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.ts Lines 142 to 150 in d23edd2
|
Adding that new API would be great! I found you can also call vscode.commands.executeCommand('editor.detectLanguage') which will run the detection on the active editor.. but it's not silent, and if it does not find a match a warning notification is displayed. Would it be easier to add a silent option to that command ? |
Some times I'm fetching some content from the web and pasting it into the current active editor.
So far, I didn't find any way to set the current language for the window. Is there any particular API call for that?
Even better, would it be possible to trigger the auto detection mechanism with the API?
The text was updated successfully, but these errors were encountered: