Skip to content

Commit

Permalink
feat: Enable goto definition for upstream language server (#206)
Browse files Browse the repository at this point in the history
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
  • Loading branch information
trevor-scheer and phryneas authored Sep 16, 2024
1 parent f899970 commit 2202342
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/language-server/project/rover/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
SemanticTokensRegistrationType,
SemanticTokensOptions,
SemanticTokensRegistrationOptions,
DefinitionRequest,
} from "vscode-languageserver/node";
import cp from "node:child_process";
import { GraphQLProjectConfig } from "../base";
Expand Down Expand Up @@ -281,6 +282,11 @@ export class RoverProject extends GraphQLProject {
this.sendRequest(HoverRequest.type, virtualParams, token),
);

onDefinition: GraphQLProject["onDefinition"] = async (params, token) =>
this.documents.insideVirtualDocument(params, (virtualParams) =>
this.sendRequest(DefinitionRequest.type, virtualParams, token),
);

onUnhandledRequest: GraphQLProject["onUnhandledRequest"] = async (
type,
params,
Expand Down

0 comments on commit 2202342

Please sign in to comment.