forked from ember-tooling/ember-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: addon-api hover provider (ember-tooling#327)
* feat: addon-api hover provider * fix typings * attempt to improve coverage * fix found issues * update snapshot * support optional providers in default function, * rollback package.json changes * fix missing addons meta * fix snapshot tests * increase test timeout
- Loading branch information
Showing
11 changed files
with
245 additions
and
45 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Hover, HoverParams } from 'vscode-languageserver/node'; | ||
import Server from '../server'; | ||
import { queryELSAddonsAPIChain } from './../utils/addon-api'; | ||
|
||
export class HoverProvider { | ||
constructor(private server: Server) {} | ||
async provideHovers({ textDocument, position }: HoverParams): Promise<Hover[]> { | ||
const project = this.server.projectRoots.projectForUri(textDocument.uri); | ||
|
||
if (!project) { | ||
return []; | ||
} | ||
|
||
const addonResults = await queryELSAddonsAPIChain(project.providers.hoverProviders, project.root, { | ||
textDocument, | ||
position, | ||
results: [], | ||
server: this.server, | ||
}); | ||
|
||
return addonResults; | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.