Compare commits

...

5 Commits

Author SHA1 Message Date
Geequlim
cf22aa3595 Merge pull request #138 from sevkin/137
check before calling platform-specific code
2020-01-26 16:27:00 +08:00
Vsevolod Balashov
c41bd642f0 check before calling platform-specific code
closes #137
2020-01-26 02:29:34 +03:00
geequlim
8d8f5c2d9b Support reconnect to language server when server port changed 2020-01-12 00:00:17 +08:00
Geequlim
119a7ebd23 Merge pull request #134 from Bromeon/bugfix/highlight-camel-case
Fix syntax highlighting for camelCase identifiers
2020-01-10 23:54:50 +08:00
Jan Haller
555cb1ce9a Fix syntax highlighting for camelCase identifiers
Currently, any occurrences of PascalCase identifiers (even as parts of other words) are recognized as classes.
This assumes snake_case convention for all methods and variables and makes it impossible to use camelCase. While this is the recommended GDScript style, the syntax highlighter should allow for different styles as long as it can do so unambiguously. This is already done for existing rules, but overridden by one rule with an overly general regex pattern.

This commit modifies the catch-all rule for the 'parscal_class' group to only capture whole words.
For clarity, it renames 'parscal_class' to 'pascal_case_class'.

Other groups to recognize classes remain unchanged: type_declear, function-return-type, class_def, class_new, class_is, class_enum, class_name, extends
2019-12-29 18:00:31 +01:00
4 changed files with 7 additions and 9 deletions

View File

@@ -27,7 +27,7 @@
{ "include": "#any-method" },
{ "include": "#any-property" },
{ "include": "#extends" },
{ "include": "#parscal_class" }
{ "include": "#pascal_case_class" }
],
"repository": {
"comment": {
@@ -328,11 +328,11 @@
}
]
},
"parscal_class": {
"pascal_case_class": {
"captures": {
"1": { "name": "entity.name.type.class.gdscript" }
},
"match": "([A-Z][a-zA-Z_0-9]*)"
"match": "\\b([A-Z][a-zA-Z_0-9]*)\\b"
}
}
}

View File

@@ -70,7 +70,7 @@ export class GodotTools {
let cmdEsc = `"${cmd}"`;
const shell_plugin = vscode.workspace.getConfiguration("terminal.integrated.shell");
let shell = shell_plugin ? shell_plugin.get("windows", "") || "" : "";
if (shell.endsWith("powershell.exe") && process.platform === "win32") {
if (process.platform === "win32" && shell.endsWith("powershell.exe")) {
cmdEsc = `&${cmdEsc}`;
}
return cmdEsc;

View File

@@ -82,7 +82,7 @@ export default class GDScriptLanguageClient extends LanguageClient {
connect_to_server() {
this.status = ClientStatus.PENDING;
io.connect_to_language_server();
io.connect_to_language_server(get_server_uri());
}
start(): vscode.Disposable {

View File

@@ -12,11 +12,9 @@ export class MessageIO extends EventEmitter {
writer: MessageIOWriter = null;
private socket: WebSocket = null;
private url: string = "";
constructor(url: string) {
super();
this.url = url;
}
public send_message(message: string) {
@@ -39,10 +37,10 @@ export class MessageIO extends EventEmitter {
this.emit("message", message);
}
connect_to_language_server():Promise<void> {
connect_to_language_server(url: string):Promise<void> {
return new Promise((resolve, reject) => {
this.socket = null;
const ws = new WebSocket(this.url);
const ws = new WebSocket(url);
ws.on('open', ()=>{ this.on_connected(ws); resolve(); });
ws.on('message', this.on_message.bind(this));
ws.on('error', this.on_disconnected.bind(this));