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.

Embedded languages use outer language auto-closing characters

See original GitHub issue
  • VS Code Version: 1.60.1
  • OS Version: OSX 11.6

When a language is embedded, the value of autoClosingPairs is taken from the parent language, not the embedded one. Related to #117190

Steps to reproduce

  1. Create a LaTeX file containing

    \begin{cppcode}
       int main() {
         return 0;
      }
    \end{cppcode}
    
  2. Check that inside the cppcode environment, we use the cpp embedded language

    Capture d’écran 2021-09-19 à 12 01 42
  3. Insert ` inside the cppcode environment. It automatically gets closed by '.

    Sep-19-2021 12-05-10

The latex language configuration adds ["`", "'"] to autoClosingPairs but not the latex cpp embedded language.

Am I missing something? For what it is worth, I am maintaining the LaTeX-Workshop extension.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
alexdimacommented, Sep 27, 2021

You’re perfectly correct, all the typing code always uses the outer language characters because of the way this is implemented here.

1reaction
jlelongcommented, Sep 27, 2021

I confirm that the problem still occur with a US keyboard layout.

In a regular python file, it works fine

Capture d’écran 2021-09-27 à 11 36 52

according to https://github.com/microsoft/vscode/blob/main/extensions/python/language-configuration.json#L33.

Let me precise the issue. When a language is embedded, the value of autoClosingPairs is not overwritten but instead it still has the value of the parent language.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embedded Programming Languages - Visual Studio Code
Learn how to create Language Servers to provide rich language features for embedded programming languages in Visual Studio Code.
Read more >
Embedded Scripting Languages
cpp/c++ embedded scripting languages survey. ... Python is used as embedded scripting language by GDB - GNU Debugger ; WinDBG - Windows Debugger; ......
Read more >
List of programming languages by type - Wikipedia
This is a list of notable programming languages, grouped by type. There is no overarching classification scheme for programming languages.
Read more >
Living Standard - HTML Spec
Table of contents · 1 Introduction · 2 Common infrastructure · 3 Semantics, structure, and APIs of HTML documents · 4 The elements...
Read more >
Avro vs json performance - Mesciuma |
It does not include markup languages used exclusively as document file formats If you use Avro, you can fairly easily generate an Avro...
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