question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Language guessing: Allow paste contents to override `files.defaultLanguage`?

See original GitHub issue

Speaking with @sbatten it was griped that the ā€œpaste contents into an untitled editor to set the language to the paste sourceā€ flow doesnā€™t work when you have files.defaultLanguage configured. This is intentional AFAIK but maybe worth revisiting? Relevant code:

https://github.com/microsoft/vscode/blob/33c614d11a561bfac4061cdb5f24dc4215c62e9e/src/vs/workbench/browser/parts/editor/textResourceEditor.ts#L165-L220

cc @TylerLeonhardt @bpasero

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
sbattencommented, Apr 27, 2022

in the base case of this issue, we know exactly the language because it comes from an existing file. We donā€™t rely on the model in this case.

0reactions
Tyriarcommented, May 4, 2022

šŸ‘ to configurable, I paste far more into untitled markdown files than anything else and sometimes I start with pasting code before wrapping it in backticks. Since Iā€™m comfortable with the change language keybinding I prefer to do that in the off chance I need it. If we do make it configurable Iā€™d suggest just making a separate setting and not have the language detection code consider the default language setting at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reduce automated language setting of untitled file on paste
Open a new file (defaults to plain text); Paste text from another editor; Notice it changes the language mode (expected, fine); Set language...
Read more >
PowerPoint 2016 for Mac language bug - Microsoft Community
Any pasted English text will override the default language setting to English (United States). This will ignore the local macOS language settingĀ ...
Read more >
Prevent Visual Studio Code to use auto-complete on PlainText
Look at language-specific settings . See https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings
Read more >
Domain and language detection [#3222865] | Drupal.org
You need to overwrite the `default_langcode` per domain, which should be available using Domain Config module. See the README.md file in thatĀ ...
Read more >
VS Code tips ā€” Changing the default language of untitled files
Today's VS Code setting: files.defaultLanguageUse ' Files : Default Language ' to configure the language for new files. Use "markdown" to treatĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found