KamasamaK / vscode-cfml

An extension for Visual Studio Code to assist in development with CFML.
MIT License
77 stars 23 forks source link

language identifier #3

Open lmajano opened 7 years ago

lmajano commented 7 years ago

I see there is only cfml as the language identifier. It would be good to have another one where script is used such as CFC's. Is this possible?

sosensible commented 7 years ago

These seem to work great for CFCs, and the Language Mode in the bottom information bar shows CFML when a CFC is loaded into the editor. What kind of script issue are you having?

KamasamaK commented 7 years ago

There are a few reasons to have have different language identifiers for the different syntaxes.

Syntax is a key component of how a language is defined, so it makes sense that a different syntax should probably constitute a different language (or simply dialect if you prefer). Most functionality in VS Code and LSP target language identifiers instead of file extensions, so you can more precisely target functionality. There's currently not a good solution for this, but it theoretically allows for embedded language support.

There are specific issues with CFML, some of which are outlined in the README, that could be resolved by having separate language identifiers. The example given is that Emmet targets language identifiers, but it doesn't make sense to have the same Emmet suggestions in an HTML/CFML context as it does a CFScript context. Another example is how I had to implement a workaround for contextual commenting for each syntax, which could be more properly addressed with separate language configurations. Some other issues have already been discussed elsewhere such as in ilich/vscode-coldfusion#26, which is an issue caused by user snippets needing to target a language identifier.

ghost commented 3 years ago

I am experiencing an issue described in this SO question. Is this issue relevant to this discussion?