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

Support analysis / types with Rust Analyzer #883

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e06a7a3
Support analysis / types with Rust Analyzer
Hofer-Julian Feb 14, 2024
13d87db
Python Previewer: Initialize Shumate (#884)
theCapypara Feb 16, 2024
dc07ef7
String fixes (#888)
Feb 17, 2024
47e50e1
Use async enumerate_children (#889)
sonnyp Feb 17, 2024
1d7fdad
flatpak: Remove `/app/include` from cleanup (#886)
Diego-Ivan Feb 18, 2024
74d2f4b
Add Bart Gravendeel to contributors (#890)
Feb 18, 2024
6f125ca
Update modules (#891)
sonnyp Feb 18, 2024
0c94b36
Open Workbench windows maximized
sonnyp Feb 18, 2024
535bd21
Fix extensions detection (#892)
sonnyp Feb 18, 2024
fff4b72
Solve brwap dangling process (#893)
sonnyp Feb 19, 2024
e40c779
docs: Extend contributing section (#895)
Hofer-Julian Feb 21, 2024
04f65cd
46 beta (#896)
sonnyp Feb 21, 2024
2a321be
about: Add as contributor (#898)
BharatAtbrat Feb 29, 2024
7e8400a
Fix appstream to make new Flathub validation pass
sonnyp Feb 21, 2024
74c3204
Use Flathub beta
sonnyp Mar 1, 2024
b879513
Add pylsp as the python LSP (#857)
janvhs Mar 3, 2024
f776ae1
Use an AdwDialog for Extensions (#900)
sonnyp Mar 3, 2024
07ab7ca
Replace Black with Ruff, add LSP plugin for Ruff (#902)
theCapypara Mar 3, 2024
e79b06a
cli: Add proper Python support (#903)
sonnyp Mar 4, 2024
d0601d2
Add myself to to the about section (#904)
janvhs Mar 4, 2024
6a435fe
Adapt to demos moving to src
sonnyp Mar 7, 2024
26fef95
Update dependencies and release notes (#905)
sonnyp Mar 8, 2024
2de5259
Add Rirusha to about.js (#907)
Rirusha Mar 15, 2024
e3d00d9
cli: Ignore Gtk.TreeIter deprecation in Text Fields
sonnyp Mar 16, 2024
f8dd103
Do not build separate locales
sonnyp Mar 16, 2024
bc630e3
pre 46 maintenance (#909)
sonnyp Mar 17, 2024
e52f29a
46
sonnyp Mar 20, 2024
3e4440f
Update VTE 0.76 (#911)
sonnyp Mar 20, 2024
759f15b
Clear own logs on start
sonnyp Mar 20, 2024
3641c2c
rust: Enable GNOME 46 (#910)
sonnyp Mar 20, 2024
3cc9e0e
Update Blueprint to 0.12.0
sonnyp Mar 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/langs/rust/rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
code_view.handleDiagnostics(params.diagnostics);
},
);

lspc.start().catch(console.error);
const cacheDir = GLib.get_user_cache_dir();
const rustAnalyzerCache = `${cacheDir}/rust_analyzer_cache`;
// It shouldn't be necessary to disable `useRustcWrapper`, stop doing that as soon as that issue is fixed
// https://github.com/rust-lang/rust-analyzer/issues/16565#issuecomment-1944354758
const initializationOptions = {"cargo": {"buildScripts": {"useRustcWrapper": false}}, "rust": {"analyzerTargetDir": rustAnalyzerCache}};

Check failure on line 29 in src/langs/rust/rust.js

View workflow job for this annotation

GitHub Actions / CI

Replace `"cargo":·{"buildScripts":·{"useRustcWrapper":·false}},·"rust":·{"analyzerTargetDir":·rustAnalyzerCache}` with `⏎····cargo:·{·buildScripts:·{·useRustcWrapper:·false·}·},⏎····rust:·{·analyzerTargetDir:·rustAnalyzerCache·},⏎··`
lspc.start(initializationOptions).catch(console.error);

buffer.connect("modified-changed", () => {
if (!buffer.get_modified()) return;
Expand Down
7 changes: 4 additions & 3 deletions src/lsp/LSPClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export default class LSPClient {
};
}

async start() {
async start(initializationOptions = {}) {
this._start_process();

await this._initialize();
await this._initialize(initializationOptions);
await this._didOpen();

this.ready = true;
Expand All @@ -65,7 +65,7 @@ export default class LSPClient {
return once(this, "ready");
}

async _initialize() {
async _initialize(initializationOptions = {}) {
const { capabilities, rootUri } = this;

// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize
Expand All @@ -74,6 +74,7 @@ export default class LSPClient {
clientInfo,
capabilities,
rootUri,
initializationOptions,
locale: "en",
});

Expand Down
Loading