drift icon indicating copy to clipboard operation
drift copied to clipboard

Syntax highlighting of .drift files in VSCode (almost perfect)

Open JCKodel opened this issue 4 years ago • 5 comments

To get syntax highlighting (at least the colors), I've configurated my VS code as this:

{
	"[sql]": {
		"editor.formatOnSave": false,
		"editor.formatOnPaste": false,
		"editor.formatOnType": false
	},
	"files.associations": {
		"**/*.moor": "sql"
	}
}

This will result in: image

It works, but it shows errors because it tries to parse it as an MSSQL script.

When I set the language mode to sql.none, it works as intended:

  1. Click here image

  2. Change to none here: image

The, I get the .moor file with coloring and autocomplete (throught the moor extension), without any errors (as intended).

image

My question is: how to automatically configure the .moor extension to sql language mode, with NONE pre selected?

JCKodel avatar Apr 05 '20 11:04 JCKodel

I believe this is what you're looking for: https://scottaddie.com/2016/04/10/file-to-language-associations-in-visual-studio-code/

North101 avatar Apr 05 '20 11:04 North101

After https://github.com/Dart-Code/Dart-Code/pull/2203 gets released (might take some time, the underlying apis are still experimental in VS Code) moor will be able to contribute its own highlighting.

You can already use moor's IDE with the Dart extension for VS Code. This will enable error reporting, folding, outline and (partly) navigation and auto-complete. It's still a bit buggy, but it might help.

simolus3 avatar Apr 05 '20 12:04 simolus3

I believe this is what you're looking for: https://scottaddie.com/2016/04/10/file-to-language-associations-in-visual-studio-code/

Not really. I already did all, except disable the MSSQL parsing automatically.

You can already use moor's IDE with the Dart extension for VS Code. This will enable error reporting, folding, outline and (partly) navigation and auto-complete. It's still a bit buggy, but it might help.

I'm already doing this (and I really don't care much for intellisense). But moor's IDE don't have syntax highlighting (it treats the file as text, with all text white).

JCKodel avatar Apr 05 '20 12:04 JCKodel

Solved removing all sql extensions from VSCode (it will still recognize sql files with color syntax highlighting, but won't try to parse it).

As I use Microsoft SQL Server Management Studio or Azure Data Studio for SQL stuff, that plugin will not be missed.

JCKodel avatar Apr 05 '20 12:04 JCKodel

Any news about vscode extension for .drift files?

listepo avatar Dec 03 '23 14:12 listepo