Crates.io | owl-ms-language-server |
lib.rs | owl-ms-language-server |
version | 0.1.2 |
source | src |
created_at | 2024-10-31 10:43:19.306204 |
updated_at | 2024-11-01 14:03:50.405681 |
description | An incremental analysis assistant for writing ontologies with the OWL Manchester Syntax |
homepage | |
repository | |
max_upload_size | |
id | 1429887 |
size | 357,030 |
An incremental analysis assistant for writing ontologies with the OWL 2 Web Ontology Language | Manchester Syntax.
The first thing you need to know is that in order to run a a language server you obviusly need a text editor. Most source code editors support the language server protocol in some form or another. You can find a list of supported tools on this webside but I recommend Visual Studio Code for beginners. The further instructions for each editor are listed below.
Install the visual studio code plugin by (1) opening visual studio and navigating to view > extentions. (2) Search for "owl-ms" and your should find the "Owl Mancherster Syntax" Plugin. (3) Click the "Install" button and wait. You can now use the plugin by opening a *.omn
file or by running the command "Change Language Mode" and selecting "Owl Manchester Syntax".
Make shure the language server binary is installed (See Section Installing the binary). Then add the language server, language and grammar to your languages.toml
.
[language-server.owl-ms-language-server]
command = "owl-ms-language-server"
[[language]]
name = "owl-ms"
injection-regex = "owl-ms"
scope = "text.omn"
file-types = ["omn"]
roots = []
language-servers = ["owl-ms-language-server"] # you can use the absolut path to the binary if needed
comment-token = "//"
indent = { tab-width = 4, unit = " " }
grammar = "owl-ms" # this is the default
[[grammar]]
name = "owl-ms"
source = { git = "https://github.com/janekx21/tree-sitter-owl2-manchester-syntax", rev = "a55d6bdd3104cd64bfe7178395aa6a139b5632a9" } # replace rev with head of the repository
Then fetch and build the grammar.
helix --grammar fetch
helix --grammar build
See the helix documentation page on adding languages.
Make shure the language server binary is installed (See Section Installing the binary).
Merge this setting into your coc-settings.json
(open with :CocConfig
).
{
"languageserver": {
"owl-ms": {
"command": "owl-ms-language-server",
"filetypes": ["omn"],
"rootPatterns": []
}
}
}
See the example config for testing.
This is not needed vor visual studio code.
To use the language server you have to first install it and then integrate it into you editor. This differs for each editor. Make shure cargo (the rust package manager) is installed on your system. Switch to nightly toolchain. Then to install the owl-ms-language-server binary use cargo install.
rustup default nightly
cargo install owl-ms-language-server
This installs the langauge server into Cargos's local set of installed binary crates(rust packages), likely located in $HOME/.cargo
. Make shure your PATH
variable contains $HOME/.cargo/bin
.
Alternatifly you can clone this repostiry and use cargo build
instead. Using this aproach you have to handle the created binary yourself.
To integrate the languge server into an editor not listed above use the documentation of your editor. A list of supported tools can be found on this webside.
Logs can be found under <tempdir>/owl-ms-lanugage-server.log
. On Windows <tempdir>
is most likely C:\Users\<username>\AppData\Local\Temp
, on Linux /tmp
and on MacOS /private/var/tmp
.
goto_declaration
goto_type_definition
goto_implementation
incoming_calls
outgoing_calls
supertypes
subtypes
document_highlight (highlights text that corresponds to text under the cursor)
document_link (all links in a document)
document_link_resolve (how to resolve a link)
code_lens
folding_range
selection_range
semantic_tokens
inline_value
moniker
workspace_diagnostic
signature_help
document_color
color_presentation
formatting
on_type_formatting
linked_editing_range (ranges that have the same content)
symbol (project-wide symbol search)
iri types
frames