File tree 5 files changed +42
-34
lines changed 5 files changed +42
-34
lines changed Original file line number Diff line number Diff line change
1
+ github : ctf0
Original file line number Diff line number Diff line change 3
3
// Hover to view descriptions of existing attributes.
4
4
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
5
{
6
- "version" : " 0.2.0" ,
7
- "configurations" : [
8
- {
9
- "name" : " Run Extension" ,
10
- "type" : " extensionHost" ,
11
- "request" : " launch" ,
12
- "runtimeExecutable" : " ${execPath}" ,
13
- "args" : [
14
- " --extensionDevelopmentPath=${workspaceFolder}"
15
- ],
16
- "outFiles" : [
17
- " ${workspaceFolder}/out/**/*.js"
18
- ],
19
- "preLaunchTask" : " ${defaultBuildTask}"
20
- },
21
- {
22
- "name" : " Extension Tests" ,
23
- "type" : " extensionHost" ,
24
- "request" : " launch" ,
25
- "runtimeExecutable" : " ${execPath}" ,
26
- "args" : [
27
- " --extensionDevelopmentPath=${workspaceFolder}" ,
28
- " --extensionTestsPath=${workspaceFolder}/out/test/suite/index"
29
- ],
30
- "outFiles" : [
31
- " ${workspaceFolder}/out/test/**/*.js"
32
- ],
33
- "preLaunchTask" : " ${defaultBuildTask}"
34
- }
35
- ]
6
+ "version" : " 0.2.0" ,
7
+ "configurations" : [
8
+ {
9
+ "name" : " Run Extension" ,
10
+ "type" : " extensionHost" ,
11
+ "request" : " launch" ,
12
+ "runtimeExecutable" : " ${execPath}" ,
13
+ "args" : [
14
+ " --extensionDevelopmentPath=${workspaceFolder}"
15
+ ],
16
+ "outFiles" : [
17
+ " ${workspaceFolder}/out/**/*.js"
18
+ ],
19
+ "preLaunchTask" : " ${defaultBuildTask}"
20
+ },
21
+ ]
36
22
}
Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ vsc-extension-quickstart.md
9
9
.history
10
10
.DS_Store
11
11
* .vsix
12
+ src /**
Original file line number Diff line number Diff line change @@ -9,8 +9,28 @@ based on https://github.com/MehediDracula/PHP-Namespace-Resolver which seems aba
9
9
- generate name space should work correctly for both root & sub dirs, if u have issues plz open a ticket.
10
10
- expose an API for other extensions to use
11
11
- check for namespaces project wide
12
+ - check [ CHANGELOG] ( ./CHANGELOG.md )
12
13
13
- ### Check for namespaces project wide
14
+ ### \# API
15
+
16
+ [ Read More] ( https://code.visualstudio.com/api/references/vscode-api#extensions )
17
+
18
+ ``` js
19
+ const nsResolverExtension = vscode .extensions .getExtension (' ctf0.php-namespace-resolver' );
20
+
21
+ if (nsResolverExtension == null ) {
22
+ throw new Error (" 'ctf0.php-namespace-resolver' is required" );
23
+ }
24
+
25
+ const NS_EXTENSION_PROVIDER = await nsResolverExtension .activate ();
26
+
27
+ // now u can use it like so
28
+
29
+ NS_EXTENSION_PROVIDER .getNamespace (vscode .window .activeTextEditor .document .uri ) // get namespace by file uri
30
+ NS_EXTENSION_PROVIDER .insertNamespace () // insert namespace in current active file
31
+ ```
32
+
33
+ ### \# Check for namespaces project wide
14
34
15
35
- make sure to run ` composer dump ` first & fix any reported issues.
16
36
- run ` PHP Namespace Resolver: Check for namespaces project wide `
Original file line number Diff line number Diff line change 2
2
"name" : " php-namespace-resolver" ,
3
3
"displayName" : " PHP Namespace Resolver" ,
4
4
"description" : " Import and expand php namespaces" ,
5
- "version" : " 0.4.0 " ,
5
+ "version" : " 0.4.1 " ,
6
6
"publisher" : " ctf0" ,
7
7
"author" : " ctf0" ,
8
8
"repository" : " https://github.com/ctf0/PHP-Namespace-Resolver" ,
231
231
}
232
232
},
233
233
"scripts" : {
234
- "vscode:prepublish" : " npm run esbuild-base -- --minify" ,
234
+ "vscode:prepublish" : " npm run esbuild-base -- --pure:console.log -- minify" ,
235
235
"esbuild-base" : " esbuild ./src/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node" ,
236
236
"esbuild" : " npm run esbuild-base -- --sourcemap" ,
237
237
"esbuild-watch" : " npm run esbuild-base -- --sourcemap --watch" ,
238
- "watch" : " npm run vscode:prepublish "
238
+ "watch" : " npm run esbuild "
239
239
},
240
240
"devDependencies" : {
241
241
"@types/fs-extra" : " ^9.0.13" ,
You can’t perform that action at this time.
0 commit comments