Skip to content

Commit

Permalink
LS: remove VFS update (#6311)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotmag769 authored Aug 30, 2024
1 parent 4193149 commit ac0e135
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions crates/cairo-lang-language-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,6 @@ impl Backend {
self.with_state_mut(|state| state.db.snapshot()).await
}

// TODO(spapini): Consider managing vfs in a different way, using the
// client.send_notification::<UpdateVirtualFile> call.

/// Refresh diagnostics and send diffs to client.
#[tracing::instrument(level = "debug", skip_all)]
async fn refresh_diagnostics(&self) -> LSPResult<()> {
Expand Down
7 changes: 0 additions & 7 deletions vscode-cairo/src/textDocumentProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { Context } from "./context";
import { expandMacro, vfsProvide, viewAnalyzedCrates } from "./lspRequests";

export const registerVfsProvider = (client: lc.LanguageClient, ctx: Context) => {
const eventEmitter = new vscode.EventEmitter<vscode.Uri>();

const vfsProvider: vscode.TextDocumentContentProvider = {
async provideTextDocumentContent(uri: vscode.Uri): Promise<string> {
const res = await client.sendRequest(vfsProvide, {
Expand All @@ -14,13 +12,8 @@ export const registerVfsProvider = (client: lc.LanguageClient, ctx: Context) =>

return res.content ?? "";
},
onDidChange: eventEmitter.event,
};

client.onNotification("vfs/update", (param) => {
eventEmitter.fire(param.uri);
});

ctx.extension.subscriptions.push(
vscode.workspace.registerTextDocumentContentProvider("vfs", vfsProvider),
);
Expand Down

0 comments on commit ac0e135

Please sign in to comment.