forked from yoctoproject/vscode-bitbake
-
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.
Refactor: Use common types in requests and notifications for embedded…
… languages support
- Loading branch information
1 parent
e61f183
commit b2cf131
Showing
10 changed files
with
97 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* -------------------------------------------------------------------------------------------- | ||
* Copyright (c) 2023 Savoir-faire Linux. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
* ------------------------------------------------------------------------------------------ */ | ||
|
||
export type EmbeddedLanguageType = 'bash' | 'python' | ||
|
||
export interface EmbeddedLanguageDocInfos { | ||
uri: string | ||
language: EmbeddedLanguageType | ||
lineOffset: number | ||
} |
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,21 @@ | ||
/* -------------------------------------------------------------------------------------------- | ||
* Copyright (c) 2023 Savoir-faire Linux. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
* ------------------------------------------------------------------------------------------ */ | ||
|
||
enum NotificationType { | ||
FilenameChanged = 'FilenameChanged' | ||
} | ||
|
||
export const NotificationMethod: Record<NotificationType, string> = { | ||
[NotificationType.FilenameChanged]: 'custom/fileNameChanged' | ||
} | ||
|
||
export interface NotificationParams { | ||
[NotificationType.FilenameChanged]: NotifyFileNameChangeParams | ||
} | ||
|
||
interface NotifyFileNameChangeParams { | ||
oldUriString: string | ||
newUriString: string | ||
} |
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,28 @@ | ||
/* -------------------------------------------------------------------------------------------- | ||
* Copyright (c) 2023 Savoir-faire Linux. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
* ------------------------------------------------------------------------------------------ */ | ||
|
||
import { type Position } from 'vscode' | ||
import { type EmbeddedLanguageDocInfos } from './embedded-languages' | ||
|
||
enum RequestType { | ||
EmbeddedLanguageDocInfos = 'EmbeddedLanguageDocInfos' | ||
} | ||
|
||
export const RequestMethod: Record<RequestType, string> = { | ||
[RequestType.EmbeddedLanguageDocInfos]: 'custom/requestEmbeddedLanguageDocInfos' | ||
} | ||
|
||
export interface RequestParams { | ||
[RequestType.EmbeddedLanguageDocInfos]: RequestEmbeddedLanguageDocInfosParams | ||
} | ||
|
||
export interface RequestResult { | ||
[RequestType.EmbeddedLanguageDocInfos]: Promise<EmbeddedLanguageDocInfos | undefined> | ||
} | ||
|
||
interface RequestEmbeddedLanguageDocInfosParams { | ||
uriString: string | ||
position: Position | ||
} |
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
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