-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Tools] Daedalus Language Server article #121
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 45 additions & 4 deletions
49
docs/zengin/tools/daedalus_tools/daedalus_language_server.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,46 @@ | ||
# Daedalus Language Server | ||
[Daedalus Language Server](https://github.com/kirides/vscode-daedalus) | ||
!!! todo | ||
TODO | ||
|
||
[Daedalus Language Server](https://github.com/Kirides/DaedalusLanguageServer) is a language server for Gothic's scripting language - Daedalus, created by [Kirides](https://github.com/kirides). However, it is mostly known as VSCode extension, that is in fact named [vscode-daedalus](https://github.com/kirides/vscode-daedalus). | ||
|
||
!!! Warning | ||
This article is focused on the vscode-daedalus extension, but since DLS uses [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) it could be implemented into other editors. | ||
|
||
|
||
## Installation | ||
1. **Download the.vsix File**: Navigate to the [latest release page](https://github.com/kirides/vscode-daedalus/releases) of the vscode-daedalus repository on GitHub. Download the `.vsix` file associated with the latest version available. | ||
|
||
2. **Open VSCode**: Launch Visual Studio Code on your computer. | ||
|
||
3. **Access Extensions Tab**: Go to the Extensions view in VSCode. You can do this by clicking on the square icon on the sidebar or pressing `Ctrl+Shift+X`. | ||
|
||
4. **Install from VSIX**: Click on the three dot icon located in the top right corner of the Extensions view to open the More Actions menu. Select the "Install from VSIX..." option. | ||
|
||
5. **Select the.vsix File**: A file dialog will appear asking for the path to the `.vsix` file you downloaded earlier. Navigate to the location where you saved the `.vsix` file, select it, and confirm the selection. | ||
|
||
6. **Installation Process**: VSCode will then proceed to install the Daedalus Language Server extension from the `.vsix` file. Once the installation is complete, you may need to reload VSCode to activate the new extension. | ||
|
||
7. **Verify Installation**: After reloading, check the Extensions view again to ensure that the Daedalus Language Server extension has been successfully installed. | ||
|
||
## Setup | ||
Before opening a project there are some setting that have to be changed. The table below shows which CodePage you should use according to your language. | ||
|
||
| CodePage | Languages | | ||
| -------------- | ----------------------------------------- | | ||
| windows-1250 | Czech, Polish, Hungarian, Romanian | | ||
| windows-1251 | Russian, Ukrainian | | ||
| windows-1252 | German, English, French, Italian, Spanish | | ||
| windows-1254 | Turkish | | ||
|
||
By default, DLS use windows-1252 encoding, if you want to change you have to edit the `settings.json` file. | ||
|
||
1. Open the Command Palette by pressing `Ctrl+Shift+P`. | ||
2. Type `settings.json` and select the option that appears, usually labeled "Preferences: Open User Settings (JSON)". | ||
3. Add the following lines at the end of the file (but before `}`), replacing "Windows-1250" with the appropriate code page for your language: | ||
```json | ||
"daedalusLanguageServer.fileEncoding": "Windows-1250", | ||
"daedalusLanguageServer.srcFileEncoding": "Windows-1250", | ||
"[daedalus]": { | ||
"files.encoding": "windows1250" | ||
} | ||
``` | ||
|
||
Now if you open a directory that contains e.g. `GOTHIC.SRC` file, the extension will parse it and give you all Language Server features. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the code it should also allow for a lowercase
windows-1250
.https://github.com/kirides/DaedalusLanguageServer/blob/f67a464ffd56fc37c932f456edddf5947b8efe1b/langserver/parseresultsmanager.go#L63
There is also the initial value of
1252
without the windows part 🤔https://github.com/kirides/DaedalusLanguageServer/blob/f67a464ffd56fc37c932f456edddf5947b8efe1b/langserver/lsphandler.go#L64-L65
Maybe
windows1250
could work if1252
works 😆 I'm sure there is a nice error message if the encoding is unrecognized, but would be nice of Kirides to allow all variants 🥹There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what should I change in the guide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mark this "review" as a request for changes, you can keep it as-is.
Just an observation for you guys to maybe move upstream to kirides.
From an UX standpoint being able to just set
windows1250
everywhere without the-
as an exception would be better.Don't know about DX, as perhaps using same settings between projects is better and the guide depicts some sort of standard in the "Gothic developer space".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, the plugin should automatically set the encoding of daedalus. It confuse people all the time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like Auronen tried to do something with that: kirides/vscode-daedalus#9