-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
24,684 additions
and
1,066 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ node_modules | |
coverage/ | ||
.nyc_output/ | ||
.DS_Store | ||
**/*.tsbuildinfo |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,14 @@ | ||
{ | ||
"name": "mobile-lsp-client", | ||
"description": "Client for the Salesforce Mobile Language Server, enabling language support for mobile development in VSCode.", | ||
"license": "MIT", | ||
"version": "0.0.1", | ||
"main": "out/extension.js", | ||
"publisher": "salesforce", | ||
"engines": { | ||
"vscode": "1.77.0" | ||
}, | ||
"dependencies": { | ||
"vscode-languageclient": "^9.0.1" | ||
} | ||
} |
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,83 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* SPDX-License-Identifier: MIT | ||
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
import * as path from 'path'; | ||
import { workspace, ExtensionContext } from 'vscode'; | ||
|
||
import { | ||
LanguageClient, | ||
LanguageClientOptions, | ||
ServerOptions, | ||
TransportKind | ||
} from 'vscode-languageclient/node'; | ||
|
||
let client: LanguageClient; | ||
|
||
export function activate( | ||
context: ExtensionContext, | ||
updateDiagnosticsSettingCommand: string, | ||
diagnosticsSettingSection: string | ||
) { | ||
// The server is implemented in node | ||
const serverModule = context.asAbsolutePath( | ||
path.join('lsp/server', 'out', 'server.js') | ||
); | ||
|
||
// If the extension is launched in debug mode then the debug server options are used | ||
// Otherwise the run options are used | ||
const serverOptions: ServerOptions = { | ||
run: { module: serverModule, transport: TransportKind.ipc }, | ||
debug: { | ||
module: serverModule, | ||
transport: TransportKind.ipc | ||
} | ||
}; | ||
|
||
// Get extension name | ||
const extensionTitle = | ||
context.extension.packageJSON.contributes.configuration.title; | ||
|
||
// Options to control the language client | ||
const clientOptions: LanguageClientOptions = { | ||
documentSelector: [ | ||
// Watch all js and html files, to be fine-tuned to watch for files in LWC bundle. | ||
{ scheme: 'file', language: 'javascript' }, | ||
{ scheme: 'file', language: 'html' } | ||
], | ||
synchronize: { | ||
// '.sf/config.json' and '.sfdx/sfdx-config.json' in the workspace is updated when org is authorized, switched or logged out by sf core extension. | ||
// Notify the server to re-evaluate for the updated org. | ||
fileEvents: [ | ||
workspace.createFileSystemWatcher('**/.sf/config.json'), | ||
workspace.createFileSystemWatcher('**/.sfdx/sfdx-config.json') | ||
] | ||
}, | ||
initializationOptions: { | ||
extensionTitle, | ||
updateDiagnosticsSettingCommand, | ||
diagnosticsSettingSection | ||
} | ||
}; | ||
|
||
// Create the language client and start the client. | ||
client = new LanguageClient( | ||
'LSP Mobile', | ||
'LSP Mobile Client', | ||
serverOptions, | ||
clientOptions | ||
); | ||
|
||
// Start the client. This will also launch the server | ||
client.start(); | ||
} | ||
|
||
export function deactivate(): Thenable<void> | undefined { | ||
if (!client) { | ||
return undefined; | ||
} | ||
return client.stop(); | ||
} |
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,19 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* SPDX-License-Identifier: MIT | ||
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
*/ | ||
import * as vscode from 'vscode'; | ||
import * as assert from 'assert'; | ||
import { getDocUri, activate } from './helper'; | ||
import * as sinon from 'sinon'; | ||
|
||
import { afterEach } from 'mocha'; | ||
|
||
suite('GraphQL Diagnostics Test Suite - Client', () => { | ||
afterEach(function () { | ||
sinon.restore(); | ||
}); | ||
test('Dummy gql test', async () => {}); | ||
}); |
Oops, something went wrong.