Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Server segfaults when used from an editor #394

Open
MicroTransactionsMatterToo opened this issue Sep 7, 2023 · 18 comments · May be fixed by #440
Open

Language Server segfaults when used from an editor #394

MicroTransactionsMatterToo opened this issue Sep 7, 2023 · 18 comments · May be fixed by #440
Assignees

Comments

@MicroTransactionsMatterToo

The language server crashes with a segfault when I try to use it from within Emacs, or any other editor. Executing asy -lsp from the terminal works correctly, but when I try to actually use it, it always segfaults. I haven't been able to figure out why. I'm certain that LSP is enabled. I haven't been able to replicate the issue outside of an editor. As best I can tell, it's not the lack of a TTY, so I'm kind of stumped.

@MicroTransactionsMatterToo
Copy link
Author

Got some more information. The segmentation fault occurs when using the TCP Server mode as well. I ended up having to use it because I couldn't find another way to debug the communication between the editor and the language server. I've attached the asy LSP output and the data that was going over the TCP socket. I'm not sure how to debug this using the normal stdio model, but I think it's caused by a bug somewhere in the parsing.

Socket TcpServer 127.0.0.1 3040 start.
New client 127.0.0.1 connect.
runtime: Stack overflow or segmentation fault: rerun with -nothreads
[1]    15942 IOT instruction (core dumped)  /usr/bin/asy -vvv -lsp -lspport=3040
Content-Length: 4261

{
	"id": 1,
	"params": {
		"rootUri": null,
		"initializationOptions": {},
		"capabilities": {
			"workspace": {
				"workspaceEdit": {
					"failureHandling": "abort",
					"documentChanges": true
				},
				"didChangeConfiguration": {
					"dynamicRegistration": true
				},
				"executeCommand": {},
				"applyEdit": true,
				"semanticTokens": {
					"refreshSupport": true
				},
				"configuration": true,
				"symbol": {
					"symbolKind": {
						"valueSet": [
							16,
							23,
							10,
							21,
							9,
							3,
							5,
							13,
							17,
							18,
							4,
							11,
							7,
							25,
							1,
							15,
							22,
							14,
							20,
							2,
							12,
							26,
							8,
							24,
							6,
							19
						]
					},
					"dynamicRegistration": true,
					"tagSupport": {
						"valueSet": [
							1
						]
					}
				},
				"diagnostics": {
					"refreshSupport": true
				},
				"codeLens": {
					"refreshSupport": true
				},
				"workspaceFolders": true,
				"inlayHint": {
					"refreshSupport": true
				}
			},
			"textDocument": {
				"completion": {
					"dynamicRegistration": true,
					"completionItemKind": {
						"valueSet": [
							22,
							16,
							15,
							11,
							13,
							4,
							7,
							6,
							9,
							21,
							8,
							10,
							24,
							18,
							17,
							12,
							20,
							19,
							3,
							1,
							25,
							5,
							23,
							2,
							14
						]
					},
					"completionList": {
						"itemDefaults": [
							"editRange",
							"insertTextFormat",
							"data"
						]
					},
					"completionItem": {
						"labelDetailsSupport": true,
						"documentationFormat": [
							"markdown",
							"plaintext"
						],
						"insertTextModeSupport": {
							"valueSet": [
								2
							]
						},
						"resolveSupport": {
							"properties": [
								"detail",
								"documentation",
								"additionalTextEdits"
							]
						},
						"snippetSupport": true,
						"deprecatedSupport": true,
						"insertReplaceSupport": true,
						"tagSupport": {
							"valueSet": [
								1
							]
						}
					},
					"insertTextMode": 2
				},
				"typeHierarchy": {
					"dynamicRegistration": true
				},
				"implementation": {
					"dynamicRegistration": true,
					"linkSupport": true
				},
				"typeDefinition": {
					"dynamicRegistration": true,
					"linkSupport": true
				},
				"documentHighlight": {
					"dynamicRegistration": true
				},
				"selectionRange": {
					"dynamicRegistration": true
				},
				"publishDiagnostics": {
					"dataSupport": true,
					"versionSupport": true,
					"relatedInformation": true,
					"codeDescriptionSupport": true,
					"tagSupport": {
						"valueSet": [
							1,
							2
						]
					}
				},
				"documentLink": {
					"dynamicRegistration": true,
					"tooltipSupport": true
				},
				"formatting": {
					"dynamicRegistration": true
				},
				"inlayHint": {
					"dynamicRegistration": true,
					"resolveSupport": {
						"properties": [
							"textEdits",
							"label.command"
						]
					}
				},
				"signatureHelp": {
					"dynamicRegistration": true,
					"contextSupport": true,
					"signatureInformation": {
						"parameterInformation": {
							"labelOffsetSupport": true
						},
						"activeParameterSupport": true,
						"documentationFormat": [
							"markdown",
							"plaintext"
						]
					}
				},
				"diagnostic": {
					"dynamicRegistration": true,
					"relatedDocumentSupport": true
				},
				"semanticTokens": {
					"formats": [
						"relative"
					],
					"augmentsSyntaxTokens": true,
					"tokenModifiers": [
						"abstract",
						"async",
						"declaration",
						"documentation",
						"readonly",
						"static",
						"modification",
						"definition",
						"defaultLibrary",
						"deprecated"
					],
					"requests": {
						"range": true,
						"full": {
							"delta": true
						}
					},
					"tokenTypes": [
						"struct",
						"decorator",
						"number",
						"enum",
						"namespace",
						"class",
						"type",
						"string",
						"method",
						"event",
						"interface",
						"property",
						"operator",
						"comment",
						"enumMember",
						"modifier",
						"function",
						"typeParameter",
						"macro",
						"variable",
						"keyword",
						"parameter",
						"regexp"
					],
					"dynamicRegistration": true,
					"overlappingTokenSupport": false,
					"multilineTokenSupport": true
				},
				"declaration": {
					"dynamicRegistration": true,
					"linkSupport": true
				},
				"callHierarchy": {
					"dynamicRegistration": true
				},
				"references": {
					"dynamicRegistration": true
				},
				"colorProvider": {
					"dynamicRegistration": true
				},
				"rename": {
					"prepareSupport": true,
					"dynamicRegistration": true,
					"prepareSupportDefaultBehavior": 1
				},
				"documentSymbol": {
					"symbolKind": {
						"valueSet": [
							16,
							23,
							10,
							21,
							9,
							3,
							5,
							13,
							17,
							18,
							4,
							11,
							7,
							25,
							1,
							15,
							22,
							14,
							20,
							2,
							12,
							26,
							8,
							24,
							6,
							19
						]
					},
					"dynamicRegistration": true,
					"hierarchicalDocumentSymbolSupport": true,
					"tagSupport": {
						"valueSet": [
							1
						]
					}
				},
				"rangeFormatting": {
					"dynamicRegistration": true
				},
				"definition": {
					"dynamicRegistration": true,
					"linkSupport": true
				},
				"codeLens": {
					"dynamicRegistration": true
				},
				"synchronization": {
					"dynamicRegistration": true,
					"willSaveWaitUntil": true,
					"willSave": true,
					"didSave": true
				},
				"codeAction": {
					"dataSupport": true,
					"dynamicRegistration": true,
					"isPreferredSupport": true,
					"resolveSupport": {
						"properties": [
							"edit"
						]
					},
					"codeActionLiteralSupport": {
						"codeActionKind": {
							"valueSet": [
								"quickfix",
								"refactor",
								"refactor.extract",
								"refactor.inline",
								"refactor.rewrite",
								"source.fixAll",
								"source.organizeImports"
							]
						}
					}
				},
				"hover": {
					"dynamicRegistration": true,
					"contentFormat": [
						"markdown",
						"plaintext"
					]
				}
			},
			"general": {
				"regularExpressions": {
					"engine": "ECMAScript"
				},
				"markdown": {
					"version": "3.2.2",
					"parser": "Python-Markdown"
				}
			},
			"window": {
				"workDoneProgress": true,
				"showDocument": {
					"support": true
				},
				"showMessage": {
					"messageActionItem": {
						"additionalPropertiesSupport": true
					}
				}
			}
		},
		"clientInfo": {
			"version": "1.25.0",
			"name": "Sublime Text LSP"
		},
		"rootPath": null,
		"workspaceFolders": null,
		"processId": 16463
	},
	"jsonrpc": "2.0",
	"method": "initialize"
}

@MicroTransactionsMatterToo
Copy link
Author

Did a bit more digging, the segfault occurs at asymptote/LspCpp/src/jsonrpc/RemoteEndPoint.cpp:387. It seems to be a segfault caused by the JSON parsing. I'm not familiar enough with the code base to figure out exactly why though.

@MicroTransactionsMatterToo
Copy link
Author

Done more digging. It seems to segfault if any property value in the JSON is greater in length than 1295. It also seems to segfault depending on the number of child objects in capabilities.textDocument. Seems to be a memory error somewhere.

@MicroTransactionsMatterToo
Copy link
Author

Also, if it's of use, the commit hash I used when compiling from source was aa9f81bad9478bfe8b2ab5fc5376c19c6c79c708. Output of asy --version is

Asymptote version 2.87-4 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]

ENABLED OPTIONS:
V3D      3D vector graphics output
WebGL    3D HTML rendering
OpenGL   3D OpenGL rendering
SSBO     GLSL shader storage buffer objects
GSL      GNU Scientific Library (special functions)
FFTW3    Fast Fourier transforms
Eigen    Eigenvalue library
XDR      External Data Representation (portable binary file format for V3D)
CURL     URL support
LSP      Language Server Protocol
Readline Interactive history and editing
Sigsegv  Distinguish stack overflows from segmentation faults
GC       Boehm garbage collector
threads  Render OpenGL in separate thread

DISABLED OPTIONS:

@johncbowman
Copy link
Member

Does commit 081db9d solve the problem?

@johncbowman
Copy link
Member

Is this issue still present with Asymptote 2.87?

@MicroTransactionsMatterToo
Copy link
Author

@MicroTransactionsMatterToo
Copy link
Author

Unfortunately it doesn't seem to have been resolved, in 2.87 or compiling from git. Behaviour is identical, although I haven't done a deep dive into it. I'm running it on Arch Linux, I haven't tested it in WSL or other distros.

asy --version output for the two versions I tried is:

Asymptote version 2.88-0 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]

ENABLED OPTIONS:
V3D      3D vector graphics output
WebGL    3D HTML rendering
OpenGL   3D OpenGL rendering
SSBO     GLSL shader storage buffer objects
GSL      GNU Scientific Library (special functions)
FFTW3    Fast Fourier transforms
Eigen    Eigenvalue library
XDR      External Data Representation (portable binary file format for V3D)
CURL     URL support
LSP      Language Server Protocol
Readline Interactive history and editing
Sigsegv  Distinguish stack overflows from segmentation faults
GC       Boehm garbage collector
threads  Render OpenGL in separate thread

DISABLED OPTIONS:

and

Asymptote version 2.87git [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]

ENABLED OPTIONS:
V3D      3D vector graphics output
WebGL    3D HTML rendering
OpenGL   3D OpenGL rendering
SSBO     GLSL shader storage buffer objects
GSL      GNU Scientific Library (special functions)
FFTW3    Fast Fourier transforms
XDR      External Data Representation (portable binary file format for V3D)
CURL     URL support
LSP      Language Server Protocol
Readline Interactive history and editing
Sigsegv  Distinguish stack overflows from segmentation faults
GC       Boehm garbage collector
threads  Render OpenGL in separate thread

DISABLED OPTIONS:
Eigen    Eigenvalue library

@jamievlin
Copy link
Member

jamievlin commented Apr 13, 2024

Can you please detail the steps to reproduce this? (In particular, which asymptote file are you working with - if possible, strip out any confidential data, or are you in a project?) - this would help me quite a bit

@jamievlin jamievlin linked a pull request Apr 13, 2024 that will close this issue
@MicroTransactionsMatterToo
Copy link
Author

It's unfortunately not a specific file, any attempt to use the LSP from any editor causes the issue. However, after pulling the most recent version and compiling it with -O0 and -g, I get exceptions instead of segfaults. This occurs with both stdio and TCP server modes.

The exception is shown below:

Socket TcpServer 127.0.0.1 3040 start.
asymptote: New client 127.0.0.1 connect.
asymptote: Reason:Exception  when process requestnotification message:
asymptote: _Map_base::at
asymptote: content:
asymptote: {"params":{"processId":271635,"initializationOptions":{},"rootPath":null,"capabilities":{"textDocument":{"documentHighlight":{"dynamicRegistration":true},"implementation":{"linkSupport":true,"dynamicRegistration":true},"synchronization":{"willSave":true,"didSave":true,"willSaveWaitUntil":true,"dynamicRegistration":true},"rename":{"prepareSupportDefaultBehavior":1,"prepareSupport":true,"dynamicRegistration":true},"documentSymbol":{"symbolKind":{"valueSet":[12,10,3,5,15,13,22,11,17,20,4,8,7,6,25,18,24,23,2,26,16,21,14,9,19,1]},"tagSupport":{"valueSet":[1]},"hierarchicalDocumentSymbolSupport":true,"dynamicRegistration":true},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":true},"semanticTokens":{"tokenModifiers":["async","declaration","deprecated","documentation","static","modification","definition","readonly","abstract","defaultLibrary"],"dynamicRegistration":true,"multilineTokenSupport":true,"requests":{"range":true,"full":{"delta":true}},"augmentsSyntaxTokens":true,"tokenTypes":["function","number","enum","macro","namespace","class","event","variable","string","enumMember","decorator","interface","comment","modifier","method","operator","type","struct","typeParameter","property","regexp","parameter","keyword"],"overlappingTokenSupport":false,"formats":["relative"]},"diagnostic":{"relatedDocumentSupport":true,"dynamicRegistration":true},"documentLink":{"tooltipSupport":true,"dynamicRegistration":true},"typeDefinition":{"linkSupport":true,"dynamicRegistration":true},"completion":{"insertTextMode":2,"completionItem":{"documentationFormat":["markdown","plaintext"],"insertTextModeSupport":{"valueSet":[2]},"labelDetailsSupport":true,"insertReplaceSupport":true,"snippetSupport":true,"tagSupport":{"valueSet":[1]},"deprecatedSupport":true,"resolveSupport":{"properties":["detail","documentation","additionalTextEdits"]}},"completionList":{"itemDefaults":["editRange","insertTextFormat","data"]},"completionItemKind":{"valueSet":[3,13,12,7,23,6,20,18,8,5,10,2,24,22,9,16,21,17,11,4,15,1,19,25,14]},"dynamicRegistration":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"publishDiagnostics":{"versionSupport":true,"codeDescriptionSupport":true,"tagSupport":{"valueSet":[2,1]},"dataSupport":true,"relatedInformation":true},"declaration":{"linkSupport":true,"dynamicRegistration":true},"references":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true},"typeHierarchy":{"dynamicRegistration":true},"codeAction":{"resolveSupport":{"properties":["edit"]},"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source.fixAll","source.organizeImports"]}},"dataSupport":true,"dynamicRegistration":true},"definition":{"linkSupport":true,"dynamicRegistration":true},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true,"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"inlayHint":{"resolveSupport":{"properties":["textEdits","label.command"]},"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"workspace":{"applyEdit":true,"executeCommand":{},"inlayHint":{"refreshSupport":true},"diagnostics":{"refreshSupport":true},"workspaceEdit":{"failureHandling":"abort","documentChanges":true},"didChangeConfiguration":{"dynamicRegistration":true},"symbol":{"symbolKind":{"valueSet":[12,10,3,5,15,13,22,11,17,20,4,8,7,6,25,18,24,23,2,26,16,21,14,9,19,1]},"tagSupport":{"valueSet":[1]},"dynamicRegistration":true},"configuration":true,"semanticTokens":{"refreshSupport":true},"workspaceFolders":true,"codeLens":{"refreshSupport":true}},"general":{"markdown":{"parser":"Python-Markdown","version":"3.2.2"},"regularExpressions":{"engine":"ECMAScript"}}},"rootUri":null,"clientInfo":{"version":"1.25.0","name":"Sublime Text LSP"},"workspaceFolders":null},"jsonrpc":"2.0","id":1,"method":"initialize"}

@MicroTransactionsMatterToo
Copy link
Author

MicroTransactionsMatterToo commented Apr 14, 2024

The file I'm using to debug with is:

int a = 3;


struct Test {
	int a;
	int b;
};

Test l = new Test;
l.a;

@MicroTransactionsMatterToo
Copy link
Author

Another exception, different this time, now compiled with -O2 instead of -O0

asymptote: Reason:Exception  when process requestnotification message:
asymptote: unordered_map::at
asymptote: content:
asymptote: {"method":"initialize","params":{"clientInfo":{"version":"1.29.0","name":"Sublime Text LSP"},"rootUri":null,"workspaceFolders":null,"initializationOptions":{},"capabilities":{"textDocument":{"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":true},"rename":{"prepareSupportDefaultBehavior":1,"dynamicRegistration":true,"prepareSupport":true},"inlayHint":{"dynamicRegistration":true,"resolveSupport":{"properties":["textEdits","label.command"]}},"typeHierarchy":{"dynamicRegistration":true},"diagnostic":{"relatedDocumentSupport":true,"dynamicRegistration":true},"typeDefinition":{"linkSupport":true,"dynamicRegistration":true},"synchronization":{"didSave":true,"willSaveWaitUntil":true,"dynamicRegistration":true,"willSave":true},"documentSymbol":{"symbolKind":{"valueSet":[4,23,12,3,13,8,9,7,11,6,22,26,20,14,15,10,2,16,17,1,19,18,21,25,5,24]},"dynamicRegistration":true,"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]}},"declaration":{"linkSupport":true,"dynamicRegistration":true},"references":{"dynamicRegistration":true},"publishDiagnostics":{"codeDescriptionSupport":true,"versionSupport":true,"dataSupport":true,"relatedInformation":true,"tagSupport":{"valueSet":[2,1]}},"foldingRange":{"foldingRangeKind":{"valueSet":["comment","imports","region"]},"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"],"activeParameterSupport":true,"parameterInformation":{"labelOffsetSupport":true}},"dynamicRegistration":true,"contextSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"completion":{"insertTextMode":2,"completionItemKind":{"valueSet":[14,22,8,12,3,15,5,4,19,10,6,2,20,25,18,21,13,16,1,9,17,24,7,11,23]},"completionList":{"itemDefaults":["editRange","insertTextFormat","data"]},"completionItem":{"snippetSupport":true,"tagSupport":{"valueSet":[1]},"deprecatedSupport":true,"labelDetailsSupport":true,"documentationFormat":["markdown","plaintext"],"insertReplaceSupport":true,"resolveSupport":{"properties":["detail","documentation","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[2]}},"dynamicRegistration":true},"definition":{"linkSupport":true,"dynamicRegistration":true},"selectionRange":{"dynamicRegistration":true},"implementation":{"linkSupport":true,"dynamicRegistration":true},"codeAction":{"isPreferredSupport":true,"resolveSupport":{"properties":["edit"]},"dataSupport":true,"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source.fixAll","source.organizeImports"]}}},"semanticTokens":{"formats":["relative"],"tokenTypes":["keyword","struct","interface","macro","typeParameter","namespace","function","modifier","property","operator","type","method","enumMember","comment","string","enum","event","number","parameter","variable","regexp","decorator","class"],"requests":{"range":true,"full":{"delta":true}},"augmentsSyntaxTokens":true,"overlappingTokenSupport":false,"dynamicRegistration":true,"multilineTokenSupport":true,"tokenModifiers":["definition","abstract","documentation","deprecated","readonly","defaultLibrary","declaration","static","modification","async"]},"formatting":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"rangeFormatting":{"rangesSupport":true,"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"workDoneProgress":true,"showDocument":{"support":true}},"workspace":{"symbol":{"symbolKind":{"valueSet":[4,23,12,3,13,8,9,7,11,6,22,26,20,14,15,10,2,16,17,1,19,18,21,25,5,24]},"tagSupport":{"valueSet":[1]},"dynamicRegistration":true,"resolveSupport":{"properties":["location.range"]}},"didChangeConfiguration":{"dynamicRegistration":true},"workspaceFolders":true,"codeLens":{"refreshSupport":true},"executeCommand":{},"configuration":true,"applyEdit":true,"workspaceEdit":{"failureHandling":"abort","documentChanges":true},"inlayHint":{"refreshSupport":true},"semanticTokens":{"refreshSupport":true},"diagnostics":{"refreshSupport":true}},"general":{"markdown":{"parser":"Python-Markdown","version":"3.2.2"},"regularExpressions":{"engine":"ECMAScript"}}},"processId":278502,"rootPath":null},"jsonrpc":"2.0","id":1}

@jamievlin
Copy link
Member

Thanks for the information. I'll look into this further. My apologies for not getting this done sooner

@jamievlin
Copy link
Member

Suspect this might be a race condition somehow considering boost::asio. I'll try to add mutexes

@jamievlin
Copy link
Member

@MicroTransactionsMatterToo Do you mind trying the changes in PR #440? (The build system is cmake since I'm developing this on my windows machine which does not have access to make - I did include build instructions in the branch)

This change might mitigate some of the issues you're seeing, but please let me know if it works (or doesn't)

@MicroTransactionsMatterToo
Copy link
Author

Sorry for taking so long to get back to you, have been busy with personal stuff. Unfortunately the issue remains the same as before. Output is:

:: [11:57:28.853] --> asymptote initialize (1): {'processId': 106996, 'clientInfo': {'name': 'Sublime Text LSP', 'version': '2.2.0'}, 'rootUri': None, 'rootPath': None, 'workspaceFolders': None, 'capabilities': {'general': {'regularExpressions': {'engine': 'ECMAScript'}, 'markdown': {'parser': 'Python-Markdown', 'version': '3.2.2'}}, 'textDocument': {'synchronization': {'dynamicRegistration': True, 'didSave': True, 'willSave': True, 'willSaveWaitUntil': True}, 'hover': {'dynamicRegistration': True, 'contentFormat': ['markdown', 'plaintext']}, 'completion': {'dynamicRegistration': True, 'completionItem': {'snippetSupport': True, 'deprecatedSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'tagSupport': {'valueSet': [1]}, 'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'insertReplaceSupport': True, 'insertTextModeSupport': {'valueSet': [2]}, 'labelDetailsSupport': True}, 'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'insertTextMode': 2, 'completionList': {'itemDefaults': ['editRange', 'insertTextFormat', 'data']}}, 'signatureHelp': {'dynamicRegistration': True, 'contextSupport': True, 'signatureInformation': {'activeParameterSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'parameterInformation': {'labelOffsetSupport': True}}}, 'references': {'dynamicRegistration': True}, 'documentHighlight': {'dynamicRegistration': True}, 'documentSymbol': {'dynamicRegistration': True, 'hierarchicalDocumentSymbolSupport': True, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'documentLink': {'dynamicRegistration': True, 'tooltipSupport': True}, 'formatting': {'dynamicRegistration': True}, 'rangeFormatting': {'dynamicRegistration': True, 'rangesSupport': True}, 'declaration': {'dynamicRegistration': True, 'linkSupport': True}, 'definition': {'dynamicRegistration': True, 'linkSupport': True}, 'typeDefinition': {'dynamicRegistration': True, 'linkSupport': True}, 'implementation': {'dynamicRegistration': True, 'linkSupport': True}, 'codeAction': {'dynamicRegistration': True, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.fixAll', 'source.organizeImports']}}, 'dataSupport': True, 'isPreferredSupport': True, 'resolveSupport': {'properties': ['edit']}}, 'rename': {'dynamicRegistration': True, 'prepareSupport': True, 'prepareSupportDefaultBehavior': 1}, 'colorProvider': {'dynamicRegistration': True}, 'publishDiagnostics': {'relatedInformation': True, 'tagSupport': {'valueSet': [1, 2]}, 'versionSupport': True, 'codeDescriptionSupport': True, 'dataSupport': True}, 'diagnostic': {'dynamicRegistration': True, 'relatedDocumentSupport': True}, 'selectionRange': {'dynamicRegistration': True}, 'foldingRange': {'dynamicRegistration': True, 'foldingRangeKind': {'valueSet': ['comment', 'imports', 'region']}}, 'codeLens': {'dynamicRegistration': True}, 'inlayHint': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['textEdits', 'label.command']}}, 'semanticTokens': {'dynamicRegistration': True, 'requests': {'range': True, 'full': {'delta': True}}, 'tokenTypes': ['namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator'], 'tokenModifiers': ['declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary'], 'formats': ['relative'], 'overlappingTokenSupport': False, 'multilineTokenSupport': True, 'augmentsSyntaxTokens': True}, 'callHierarchy': {'dynamicRegistration': True}, 'typeHierarchy': {'dynamicRegistration': True}}, 'workspace': {'applyEdit': True, 'didChangeConfiguration': {'dynamicRegistration': True}, 'executeCommand': {}, 'workspaceEdit': {'documentChanges': True, 'failureHandling': 'abort'}, 'workspaceFolders': True, 'symbol': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['location.range']}, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'configuration': True, 'codeLens': {'refreshSupport': True}, 'inlayHint': {'refreshSupport': True}, 'semanticTokens': {'refreshSupport': True}, 'diagnostics': {'refreshSupport': True}}, 'window': {'showDocument': {'support': True}, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}, 'workDoneProgress': True}}, 'initializationOptions': {}}
asymptote: Reason:Exception  when process requestnotification message:
asymptote: unordered_map::at
asymptote: content:
asymptote: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"processId":106996,"clientInfo":{"name":"Sublime Text LSP","version":"2.2.0"},"rootUri":null,"rootPath":null,"workspaceFolders":null,"capabilities":{"general":{"regularExpressions":{"engine":"ECMAScript"},"markdown":{"parser":"Python-Markdown","version":"3.2.2"}},"textDocument":{"synchronization":{"dynamicRegistration":true,"didSave":true,"willSave":true,"willSaveWaitUntil":true},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":true,"deprecatedSupport":true,"documentationFormat":["markdown","plaintext"],"tagSupport":{"valueSet":[1]},"resolveSupport":{"properties":["detail","documentation","additionalTextEdits"]},"insertReplaceSupport":true,"insertTextModeSupport":{"valueSet":[2]},"labelDetailsSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"insertTextMode":2,"completionList":{"itemDefaults":["editRange","insertTextFormat","data"]}},"signatureHelp":{"dynamicRegistration":true,"contextSupport":true,"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"hierarchicalDocumentSymbolSupport":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true,"rangesSupport":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source.fixAll","source.organizeImports"]}},"dataSupport":true,"isPreferredSupport":true,"resolveSupport":{"properties":["edit"]}},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1},"colorProvider":{"dynamicRegistration":true},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":true,"codeDescriptionSupport":true,"dataSupport":true},"diagnostic":{"dynamicRegistration":true,"relatedDocumentSupport":true},"selectionRange":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"foldingRangeKind":{"valueSet":["comment","imports","region"]}},"codeLens":{"dynamicRegistration":true},"inlayHint":{"dynamicRegistration":true,"resolveSupport":{"properties":["textEdits","label.command"]}},"semanticTokens":{"dynamicRegistration":true,"requests":{"range":true,"full":{"delta":true}},"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"overlappingTokenSupport":false,"multilineTokenSupport":true,"augmentsSyntaxTokens":true},"callHierarchy":{"dynamicRegistration":true},"typeHierarchy":{"dynamicRegistration":true}},"workspace":{"applyEdit":true,"didChangeConfiguration":{"dynamicRegistration":true},"executeCommand":{},"workspaceEdit":{"documentChanges":true,"failureHandling":"abort"},"workspaceFolders":true,"symbol":{"dynamicRegistration":true,"resolveSupport":{"properties":["location.range"]},"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"configuration":true,"codeLens":{"refreshSupport":true},"inlayHint":{"refreshSupport":true},"semanticTokens":{"refreshSupport":true},"diagnostics":{"refreshSupport":true}},"window":{"showDocument":{"support":true},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"workDoneProgress":true}},"initializationOptions":{}}}

@MicroTransactionsMatterToo
Copy link
Author

Running it under debugging gets a bit farther, it doesn't constantly throw errors, however it still doesn't seem to be working, it never returns any completion information

Sublime Text Logs

:: [12:17:37.189] --> asymptote initialize (1): {'processId': 114011, 'clientInfo': {'name': 'Sublime Text LSP', 'version': '2.2.0'}, 'rootUri': None, 'rootPath': None, 'workspaceFolders': None, 'capabilities': {'general': {'regularExpressions': {'engine': 'ECMAScript'}, 'markdown': {'parser': 'Python-Markdown', 'version': '3.2.2'}}, 'textDocument': {'synchronization': {'dynamicRegistration': True, 'didSave': True, 'willSave': True, 'willSaveWaitUntil': True}, 'hover': {'dynamicRegistration': True, 'contentFormat': ['markdown', 'plaintext']}, 'completion': {'dynamicRegistration': True, 'completionItem': {'snippetSupport': True, 'deprecatedSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'tagSupport': {'valueSet': [1]}, 'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'insertReplaceSupport': True, 'insertTextModeSupport': {'valueSet': [2]}, 'labelDetailsSupport': True}, 'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'insertTextMode': 2, 'completionList': {'itemDefaults': ['editRange', 'insertTextFormat', 'data']}}, 'signatureHelp': {'dynamicRegistration': True, 'contextSupport': True, 'signatureInformation': {'activeParameterSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'parameterInformation': {'labelOffsetSupport': True}}}, 'references': {'dynamicRegistration': True}, 'documentHighlight': {'dynamicRegistration': True}, 'documentSymbol': {'dynamicRegistration': True, 'hierarchicalDocumentSymbolSupport': True, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'documentLink': {'dynamicRegistration': True, 'tooltipSupport': True}, 'formatting': {'dynamicRegistration': True}, 'rangeFormatting': {'dynamicRegistration': True, 'rangesSupport': True}, 'declaration': {'dynamicRegistration': True, 'linkSupport': True}, 'definition': {'dynamicRegistration': True, 'linkSupport': True}, 'typeDefinition': {'dynamicRegistration': True, 'linkSupport': True}, 'implementation': {'dynamicRegistration': True, 'linkSupport': True}, 'codeAction': {'dynamicRegistration': True, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.fixAll', 'source.organizeImports']}}, 'dataSupport': True, 'isPreferredSupport': True, 'resolveSupport': {'properties': ['edit']}}, 'rename': {'dynamicRegistration': True, 'prepareSupport': True, 'prepareSupportDefaultBehavior': 1}, 'colorProvider': {'dynamicRegistration': True}, 'publishDiagnostics': {'relatedInformation': True, 'tagSupport': {'valueSet': [1, 2]}, 'versionSupport': True, 'codeDescriptionSupport': True, 'dataSupport': True}, 'diagnostic': {'dynamicRegistration': True, 'relatedDocumentSupport': True}, 'selectionRange': {'dynamicRegistration': True}, 'foldingRange': {'dynamicRegistration': True, 'foldingRangeKind': {'valueSet': ['comment', 'imports', 'region']}}, 'codeLens': {'dynamicRegistration': True}, 'inlayHint': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['textEdits', 'label.command']}}, 'semanticTokens': {'dynamicRegistration': True, 'requests': {'range': True, 'full': {'delta': True}}, 'tokenTypes': ['namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator'], 'tokenModifiers': ['declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary'], 'formats': ['relative'], 'overlappingTokenSupport': False, 'multilineTokenSupport': True, 'augmentsSyntaxTokens': True}, 'callHierarchy': {'dynamicRegistration': True}, 'typeHierarchy': {'dynamicRegistration': True}}, 'workspace': {'applyEdit': True, 'didChangeConfiguration': {'dynamicRegistration': True}, 'executeCommand': {}, 'workspaceEdit': {'documentChanges': True, 'failureHandling': 'abort'}, 'workspaceFolders': True, 'symbol': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['location.range']}, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'configuration': True, 'codeLens': {'refreshSupport': True}, 'inlayHint': {'refreshSupport': True}, 'semanticTokens': {'refreshSupport': True}, 'diagnostics': {'refreshSupport': True}}, 'window': {'showDocument': {'support': True}, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}, 'workDoneProgress': True}}, 'initializationOptions': {}}
:: [12:17:54.269] --> asymptote initialize (1): {'processId': 114011, 'clientInfo': {'name': 'Sublime Text LSP', 'version': '2.2.0'}, 'rootUri': None, 'rootPath': None, 'workspaceFolders': None, 'capabilities': {'general': {'regularExpressions': {'engine': 'ECMAScript'}, 'markdown': {'parser': 'Python-Markdown', 'version': '3.2.2'}}, 'textDocument': {'synchronization': {'dynamicRegistration': True, 'didSave': True, 'willSave': True, 'willSaveWaitUntil': True}, 'hover': {'dynamicRegistration': True, 'contentFormat': ['markdown', 'plaintext']}, 'completion': {'dynamicRegistration': True, 'completionItem': {'snippetSupport': True, 'deprecatedSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'tagSupport': {'valueSet': [1]}, 'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'insertReplaceSupport': True, 'insertTextModeSupport': {'valueSet': [2]}, 'labelDetailsSupport': True}, 'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'insertTextMode': 2, 'completionList': {'itemDefaults': ['editRange', 'insertTextFormat', 'data']}}, 'signatureHelp': {'dynamicRegistration': True, 'contextSupport': True, 'signatureInformation': {'activeParameterSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'parameterInformation': {'labelOffsetSupport': True}}}, 'references': {'dynamicRegistration': True}, 'documentHighlight': {'dynamicRegistration': True}, 'documentSymbol': {'dynamicRegistration': True, 'hierarchicalDocumentSymbolSupport': True, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'documentLink': {'dynamicRegistration': True, 'tooltipSupport': True}, 'formatting': {'dynamicRegistration': True}, 'rangeFormatting': {'dynamicRegistration': True, 'rangesSupport': True}, 'declaration': {'dynamicRegistration': True, 'linkSupport': True}, 'definition': {'dynamicRegistration': True, 'linkSupport': True}, 'typeDefinition': {'dynamicRegistration': True, 'linkSupport': True}, 'implementation': {'dynamicRegistration': True, 'linkSupport': True}, 'codeAction': {'dynamicRegistration': True, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.fixAll', 'source.organizeImports']}}, 'dataSupport': True, 'isPreferredSupport': True, 'resolveSupport': {'properties': ['edit']}}, 'rename': {'dynamicRegistration': True, 'prepareSupport': True, 'prepareSupportDefaultBehavior': 1}, 'colorProvider': {'dynamicRegistration': True}, 'publishDiagnostics': {'relatedInformation': True, 'tagSupport': {'valueSet': [1, 2]}, 'versionSupport': True, 'codeDescriptionSupport': True, 'dataSupport': True}, 'diagnostic': {'dynamicRegistration': True, 'relatedDocumentSupport': True}, 'selectionRange': {'dynamicRegistration': True}, 'foldingRange': {'dynamicRegistration': True, 'foldingRangeKind': {'valueSet': ['comment', 'imports', 'region']}}, 'codeLens': {'dynamicRegistration': True}, 'inlayHint': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['textEdits', 'label.command']}}, 'semanticTokens': {'dynamicRegistration': True, 'requests': {'range': True, 'full': {'delta': True}}, 'tokenTypes': ['namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator'], 'tokenModifiers': ['declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary'], 'formats': ['relative'], 'overlappingTokenSupport': False, 'multilineTokenSupport': True, 'augmentsSyntaxTokens': True}, 'callHierarchy': {'dynamicRegistration': True}, 'typeHierarchy': {'dynamicRegistration': True}}, 'workspace': {'applyEdit': True, 'didChangeConfiguration': {'dynamicRegistration': True}, 'executeCommand': {}, 'workspaceEdit': {'documentChanges': True, 'failureHandling': 'abort'}, 'workspaceFolders': True, 'symbol': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['location.range']}, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'configuration': True, 'codeLens': {'refreshSupport': True}, 'inlayHint': {'refreshSupport': True}, 'semanticTokens': {'refreshSupport': True}, 'diagnostics': {'refreshSupport': True}}, 'window': {'showDocument': {'support': True}, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}, 'workDoneProgress': True}}, 'initializationOptions': {}}
:: [12:17:54.287] <<< asymptote (1) (duration: 17ms): {'capabilities': {'hoverProvider': True, 'definitionProvider': True, 'colorProvider': True, 'textDocumentSync': {'change': {'syncKind': 1}, 'didOpen': {}, 'didClose': {}, 'save': {'includeText': True}}}}
:: [12:17:54.287]  -> asymptote initialized: {}
:: [12:17:54.290]  -> asymptote textDocument/didOpen: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'languageId': 'asy', 'version': 6, 'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\n\n\nG.a;'}}
:: [12:17:54.290] --> asymptote textDocument/documentColor (2): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:17:54.328] <<< asymptote (2) (duration: 38ms): []
:: [12:17:57.508]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 9}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\n\n\nG'}]}
:: [12:17:57.508] --> asymptote textDocument/documentColor (3): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:17:58.003]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 10}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\n\n\n'}]}
:: [12:17:58.004] --> asymptote textDocument/documentColor (4): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:39.752] <<< asymptote (3) (duration: 42243ms): []
:: [12:18:39.752] <<< asymptote (4) (duration: 41747ms): []
:: [12:18:43.270]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 13}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);'}]}
:: [12:18:43.270] --> asymptote textDocument/documentColor (5): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:43.276] <<< asymptote (5) (duration: 5ms): []
:: [12:18:49.237]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 15}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG'}]}
:: [12:18:49.238] --> asymptote textDocument/documentColor (6): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:49.596]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 16}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.'}]}
:: [12:18:49.597] --> asymptote textDocument/documentColor (7): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:53.508]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 17}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x'}]}
:: [12:18:53.513] --> asymptote textDocument/documentColor (8): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:53.946]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 18}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x;'}]}
:: [12:18:53.947] --> asymptote textDocument/documentColor (9): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:55.200]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 22}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = '}]}
:: [12:18:55.200] --> asymptote textDocument/documentColor (10): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:55.765]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 23}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = 0'}]}
:: [12:18:55.765] --> asymptote textDocument/documentColor (11): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:56.519]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 26}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = 1;'}]}
:: [12:18:56.520] --> asymptote textDocument/documentColor (12): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:18:56.571]  -> asymptote textDocument/didSave: {'textDocument': {'uri': 'file:///home/ennis/test.asy'}, 'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = 1;'}
:: [12:19:05.109] <<< asymptote (6) (duration: 15871ms): []
:: [12:19:05.110] <<< asymptote (7) (duration: 15513ms): []
:: [12:19:06.732] <<< asymptote (8) (duration: 13218ms): []
:: [12:19:06.732] <<< asymptote (9) (duration: 12785ms): []
:: [12:19:06.732] <<< asymptote (10) (duration: 11532ms): []
:: [12:19:08.096] <<< asymptote (11) (duration: 12330ms): []
:: [12:19:08.096] <<< asymptote (12) (duration: 11576ms): []
:: [12:19:18.723]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 28}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = '}]}
:: [12:19:18.724] --> asymptote textDocument/documentColor (13): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:19:18.727] <<< asymptote (13) (duration: 3ms): []
:: [12:19:21.176]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 29}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = 0'}]}
:: [12:19:21.176] --> asymptote textDocument/documentColor (14): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:19:21.216] <<< asymptote (14) (duration: 39ms): []
:: [12:19:21.754]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 30}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = 0;'}]}
:: [12:19:21.754] --> asymptote textDocument/documentColor (15): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:19:21.794] <<< asymptote (15) (duration: 39ms): []
:: [12:19:23.900]  -> asymptote textDocument/didSave: {'textDocument': {'uri': 'file:///home/ennis/test.asy'}, 'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = 0;'}
:: [12:20:23.111]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 36}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = 0;\n\nfoo.'}]}
:: [12:20:23.111] --> asymptote textDocument/documentColor (16): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:20:23.113] <<< asymptote (16) (duration: 1ms): []
:: [12:20:27.451]  -> asymptote textDocument/didChange: {'textDocument': {'uri': 'file:///home/ennis/test.asy', 'version': 37}, 'contentChanges': [{'text': 'struct Test {\n\tint a;\n\tstring b;\n};\n\nTest foo = new Test;\npair G = (0, 0);\nG.x = 0;\n\n'}]}
:: [12:20:27.452] --> asymptote textDocument/documentColor (17): {'textDocument': {'uri': 'file:///home/ennis/test.asy'}}
:: [12:20:27.492] <<< asymptote (17) (duration: 40ms): []

LSP Output

Socket TcpServer 127.0.0.1 30999 start.
New client 127.0.0.1 connect.
/home/ennis/compile-dir/asysrc/asymptote/base/plain.asy
server initialized notification
onOpen notification
/home/ennis/test.asy
text change notification

^
<eval>: 10.1: unexpected end of input
: Got Document color request.
text change notification
changed text data
Got Document color request.
/home/ennis/test.asy
changed text data
text change notification
/home/ennis/test.asy
changed text data
Got Document color request.
text change notification


^
<eval>: 8.1: unexpected end of input
: Got Document color request.
text change notification
changed text data
Got Document color request.


text change notification
 ^
<eval>: 
8.2: unexpected end of input
: 
  ^
<eval>: 8.3: unexpected end of input
: changed text data
Got Document color request.
changed text data
text change notification
Got Document color request.
text change notification
/home/ennis/test.asy

changed text data

     Got Document color request.
^
<eval>: 8.6: unexpected end of input
: text change notification


      ^
<eval>: 8.7: unexpected end of input
: changed text data
Got Document color request.
text change notification
changed text data
Got Document color request.
/home/ennis/test.asy
changed text data
onSave notification
text change notification


     ^
<eval>: 8.6: unexpected end of input
: changed text data
Got Document color request.
text change notification


      ^
<eval>: 8.7: unexpected end of input
: changed text data
Got Document color request.
text change notification
/home/ennis/test.asy
changed text data
Got Document color request.
onSave notification
text change notification


   ^
<eval>: 10.4: unexpected end of input
: changed text data
Got Document color request.
text change notification
/home/ennis/test.asy
changed text data
Got Document color request.

@MicroTransactionsMatterToo
Copy link
Author

Okay, on further testing, some stuff does work, hovering, getting functions definitions and that's about it. Looking at it, it seems that the completion endpoint isn't implemented, which would explain that issue. But there's something else going wrong if it won't run when not being debugged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants