Skip to content

Commit 6ea041c

Browse files
authored
Merge pull request #205 from aurelia/feat/extract-component
Feat/extract component
2 parents 94a34a9 + 41d60e1 commit 6ea041c

File tree

31 files changed

+17463
-119
lines changed

31 files changed

+17463
-119
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ references:
55
run:
66
name: npm-update-and-install
77
command: |
8-
sudo npm install -g npm@latest
8+
sudo npm install -g npm@8.5.0
99
npm i
1010
npm run postinstall
1111
1212
jobs:
1313
build:
1414
docker:
15-
- image: circleci/node:latest
15+
- image: circleci/node:gallium
1616
steps:
1717
- checkout
1818
- *npm_install_update
@@ -21,7 +21,7 @@ jobs:
2121
command: npm run vscode:prepublish
2222
test:
2323
docker:
24-
- image: circleci/node:latest
24+
- image: circleci/node:gallium
2525
steps:
2626
- checkout
2727
- *npm_install_update
@@ -33,7 +33,7 @@ jobs:
3333
command: npm run test:ci
3434
publish:
3535
docker:
36-
- image: circleci/node:latest
36+
- image: circleci/node:gallium
3737
steps:
3838
- checkout
3939
- *npm_install_update
@@ -45,7 +45,7 @@ jobs:
4545
command: npx vsce publish -p ${VSTOKEN}
4646
prerelease:
4747
docker:
48-
- image: circleci/node:latest
48+
- image: circleci/node:gallium
4949
steps:
5050
- checkout
5151
- *npm_install_update

client/package-lock.json

Lines changed: 78 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/extension.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'reflect-metadata';
22
import * as path from 'path';
33

4-
import { commands, workspace, ExtensionContext } from 'vscode';
4+
import { commands, window, workspace, ExtensionContext } from 'vscode';
55
import {
66
Disposable,
77
LanguageClient,
@@ -15,10 +15,11 @@ import {
1515
} from 'vscode-languageclient';
1616

1717
import { RelatedFiles } from './feature/relatedFiles';
18+
import { getUserInputCommand } from './feature/userInput/userInput';
1819

1920
let client: LanguageClient;
2021

21-
export function activate(context: ExtensionContext) {
22+
export async function activate(context: ExtensionContext) {
2223
// The server is implemented in node
2324
const serverModule = context.asAbsolutePath(
2425
path.join('server', 'out', 'server.js')
@@ -95,12 +96,34 @@ export function activate(context: ExtensionContext) {
9596
client.start();
9697

9798
/** ISSUE-VaNcstW0 */
98-
// await client.onReady();
99+
await client.onReady();
99100
// User Information
100101
// client.onRequest('warning:no-tsconfig-found', () => {
101102
// const message = '[Aurelia] No tsconfig.json found. Please visit the [Usage section](https://github.com/aurelia/vscode-extension#1-usage) for more information.';
102103
// vscode.window.showWarningMessage(message, 'Close')
103104
// })
105+
106+
client.onRequest('get-component-name', () => {
107+
getUserInputCommand(context);
108+
109+
var editor = window.activeTextEditor;
110+
/* prettier-ignore */ console.log('>>>> _ >>>> ~ file: extension.ts ~ line 115 ~ editor?.selections', editor?.selections)
111+
112+
// const message = '[Aurelia] No tsconfig.json found. Please visit the [Usage section](https://github.com/aurelia/vscode-extension#1-usage) for more information.';
113+
// window.showWarningMessage(message, 'Close')
114+
});
115+
116+
client.onRequest('get-editer-selections', () => {
117+
var editor = window.activeTextEditor;
118+
const documentText = editor?.document.getText();
119+
/* prettier-ignore */ console.log('>>>> _ >>>> ~ file: extension.ts ~ line 120 ~ documentText', documentText)
120+
return {
121+
documentText,
122+
documentUri: editor?.document.uri.toString(),
123+
documentPath: editor?.document.fileName,
124+
selections: editor?.selections,
125+
};
126+
});
104127
}
105128

106129
export function deactivate(): Thenable<void> | undefined {

0 commit comments

Comments
 (0)