mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2025-12-31 13:48:24 +03:00
Fixes for gdscript syntax checking (#7)
* Fixed the typo in the folder name configrations Now the name is configurations. All the code referencing the folder has also been updated. * Updated deprecated variables * Demonstration of current diagnostics issues All the lines that get a complaint from diagnostics are marked with #in 0.2.2 and a short explanation whether the complaint is valid or not. * Enabled syntax highlighting for comments Now comments have a different colour compared to variables. Found it unclear which file controls syntax so edited both GDScript.full.tmLanguage.json and GDScript.tmLanguage.json. In addition renamed test_files directory to be clearer and started working on diagnostic.ts to fix false positives in syntax highglighting. * Fixed checking comments for syntax Now comments are not checked for syntax. This was achieved by excluding comments from being parsed. In addition made it so that syntax check no longer complains about empty lines having wrong indentation. * Wrong committer details on previous commits This commit should have the correct details. * Added a comment explaining how nextline is parsed * Reverted changes in symbolparser.ts Also made minor additions to test_files.
This commit is contained in:
219
configurations/GDScript.full.tmLanguage.json
Normal file
219
configurations/GDScript.full.tmLanguage.json
Normal file
File diff suppressed because one or more lines are too long
207
configurations/GDScript.tmLanguage.json
Normal file
207
configurations/GDScript.tmLanguage.json
Normal file
File diff suppressed because one or more lines are too long
25
configurations/gdscript-configuration.json
Normal file
25
configurations/gdscript-configuration.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": "#",
|
||||
"blockComment": ["\"\"\"", "\"\"\""]
|
||||
},
|
||||
"brackets": [
|
||||
["(", ")"],
|
||||
["[", "]"],
|
||||
["{", "}"]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
["'", "'"],
|
||||
["\"", "\""],
|
||||
["(", ")"],
|
||||
["[", "]"],
|
||||
["{", "}"]
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["'", "'"],
|
||||
["\"", "\""],
|
||||
["(", ")"],
|
||||
["[", "]"],
|
||||
["{", "}"]
|
||||
]
|
||||
}
|
||||
196
configurations/snippets.json
Normal file
196
configurations/snippets.json
Normal file
@@ -0,0 +1,196 @@
|
||||
{
|
||||
|
||||
// Place your snippets for JavaScript React here. Each snippet is defined under a snippet name and has a prefix, body and
|
||||
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
|
||||
// $1, $2 for tab stops, ${id} and ${id:label} and ${1:label} for variables. Variables with the same id are connected.
|
||||
// Example:
|
||||
"Subclass": {
|
||||
"prefix": "class",
|
||||
"body": [
|
||||
"class $1 extends ${2:Reference}",
|
||||
"\t$3"
|
||||
]
|
||||
},
|
||||
|
||||
"Print messages to console": {
|
||||
"prefix": "pr",
|
||||
"body": [
|
||||
"print($1)"
|
||||
]
|
||||
},
|
||||
|
||||
"_ready method of Node": {
|
||||
"prefix": "ready",
|
||||
"body": [
|
||||
"func _ready():",
|
||||
"\t${1:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"_init method of Object": {
|
||||
"prefix": "init",
|
||||
"body": [
|
||||
"func _init():",
|
||||
"\t${1:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"_process method of Node": {
|
||||
"prefix": "process",
|
||||
"body": [
|
||||
"func _process(delta):",
|
||||
"\t${1:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"_input method of Node": {
|
||||
"prefix": "input",
|
||||
"body": [
|
||||
"func _input(event):",
|
||||
"\t${1:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"_input_event method of Node": {
|
||||
"prefix": "inpute",
|
||||
"body": [
|
||||
"func _input_event(event):",
|
||||
"\t${1:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"for loop": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"for $1 in $2:",
|
||||
"\t${3:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"for range loop": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"for $1 in range(${2:start}{$3:,end}):",
|
||||
"\t${4:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"if elif else": {
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if ${1:condition}:",
|
||||
"\t${3:pass}",
|
||||
"elif ${2:condition}:",
|
||||
"\t${4:pass}",
|
||||
"else:",
|
||||
"\t${5:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"if else": {
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if ${1:condition}:",
|
||||
"\t${2:pass}",
|
||||
"else:",
|
||||
"\t${3:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"if": {
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if ${1:condition}:",
|
||||
"\t${2:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"while": {
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"while ${1:condition}:",
|
||||
"\t${2:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"function define": {
|
||||
"prefix": "func",
|
||||
"body": [
|
||||
"func ${1:method}(${2:args}):",
|
||||
"\t${3:pass}"
|
||||
]
|
||||
},
|
||||
|
||||
"signal decleration": {
|
||||
"prefix": "signal",
|
||||
"body": [
|
||||
"signal ${1:signalname}(${2:args})"
|
||||
]
|
||||
},
|
||||
|
||||
"export variables": {
|
||||
"prefix": "export",
|
||||
"body": [
|
||||
"export(${1:type}${2:,other_configs}) var ${3:name}${4: = default}${5: setget }"
|
||||
]
|
||||
},
|
||||
|
||||
"define variables": {
|
||||
"prefix": "var",
|
||||
"body": [
|
||||
"var ${1:name}${2: = default}${3: setget }"
|
||||
]
|
||||
},
|
||||
|
||||
"define onready variables": {
|
||||
"prefix": "onready",
|
||||
"body": [
|
||||
"onready var ${1:name}${2: = default}${3: setget }"
|
||||
]
|
||||
},
|
||||
|
||||
"Is instance of a class": {
|
||||
"prefix": "extends",
|
||||
"body": [
|
||||
"${1:instance} extends ${2:class_name}"
|
||||
]
|
||||
},
|
||||
|
||||
"element in array": {
|
||||
"prefix": "in",
|
||||
"body": [
|
||||
"${1:element} in ${$2:array}"
|
||||
]
|
||||
},
|
||||
|
||||
"GDScript template": {
|
||||
"prefix": "gdscript",
|
||||
"body": [
|
||||
"extends ${1:BaseClass}",
|
||||
"",
|
||||
"# class member variables go here, for example:",
|
||||
"# var a = 2",
|
||||
"# var b = \"textvar\"",
|
||||
"",
|
||||
"func _ready():",
|
||||
"\t# Called every time the node is added to the scene.",
|
||||
"\t# Initialization here",
|
||||
"\tpass",
|
||||
""
|
||||
]
|
||||
},
|
||||
|
||||
"Enable process function": {
|
||||
"prefix": "process",
|
||||
"body": [
|
||||
"set_process(true)"
|
||||
]
|
||||
},
|
||||
|
||||
"Enable process input function": {
|
||||
"prefix": "processin",
|
||||
"body": [
|
||||
"set_process_input(true)"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user