File tree 6 files changed +65
-4
lines changed
6 files changed +65
-4
lines changed Original file line number Diff line number Diff line change 12
12
- Go to definition now goes to real file if such presented, or opens from the server
13
13
- Basic syntax highlighting for CSP files, only as HTML
14
14
- Added some snippets for class
15
- - View subclasses for current class, available in command palette
15
+ - Go to Subclass for the current class, available in command palette
16
+ - Go to Super class for the current class, available in command palette
16
17
- Go To any class/method in the workspace including server (by Cmd+T/Ctrl+T)
17
18
- some small fixes in the highlighting, and selecting words/variables
18
19
- Intellisense. Show list of methods for ##class(SomeClass)
20
+ - Go to macros definition
19
21
20
22
## [ 0.7.7]
21
23
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export async function subclass(): Promise<void> {
26
26
return api
27
27
. actionQuery ( 'CALL %Dictionary.ClassDefinitionQuery_SubclassOf(?)' , [ className ] )
28
28
. then ( data => {
29
- const list = data . result . content || [ ] ;
29
+ const list = data . result . content . slice ( 0 , 100 ) || [ ] ;
30
30
if ( ! list . length ) {
31
31
return ;
32
32
}
Original file line number Diff line number Diff line change
1
+ import * as vscode from 'vscode' ;
2
+ import { config } from '../extension' ;
3
+ import { currentFile } from '../utils' ;
4
+ import { DocumentContentProvider } from '../providers/DocumentContentProvider' ;
5
+ import { ClassDefinition } from '../utils/classDefinition' ;
6
+
7
+ export async function superclass ( ) : Promise < void > {
8
+ if ( ! config ( 'conn' ) . active ) {
9
+ return ;
10
+ }
11
+ const file = currentFile ( ) ;
12
+ if ( ! file || ! file . name . toLowerCase ( ) . endsWith ( '.cls' ) ) {
13
+ return ;
14
+ }
15
+
16
+ const open = item => {
17
+ let uri = DocumentContentProvider . getUri ( item + '.cls' ) ;
18
+ vscode . window . showTextDocument ( uri ) ;
19
+ } ;
20
+
21
+ const classDefinition = new ClassDefinition ( file . name ) ;
22
+ return classDefinition
23
+ . super ( )
24
+ . then ( data => {
25
+ const list = data || [ ] ;
26
+ if ( ! list . length ) {
27
+ return ;
28
+ }
29
+ vscode . window . showQuickPick ( list ) . then ( item => {
30
+ open ( item ) ;
31
+ } ) ;
32
+ } )
33
+ . catch ( err => console . error ( err ) ) ;
34
+ }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { importAndCompile } from './commands/compile';
8
8
import { exportAll , exportExplorerItem } from './commands/export' ;
9
9
import { xml2doc } from './commands/xml2doc' ;
10
10
import { subclass } from './commands/subclass' ;
11
+ import { superclass } from './commands/superclass' ;
11
12
12
13
import { ObjectScriptClassSymbolProvider } from './providers/ObjectScriptClassSymbolProvider' ;
13
14
import { ObjectScriptRoutineSymbolProvider } from './providers/ObjectScriptRoutineSymbolProvider' ;
@@ -131,6 +132,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
131
132
vscode . commands . registerCommand ( 'vscode-objectscript.export' , exportAll ) ,
132
133
vscode . commands . registerCommand ( 'vscode-objectscript.viewOthers' , viewOthers ) ,
133
134
vscode . commands . registerCommand ( 'vscode-objectscript.subclass' , subclass ) ,
135
+ vscode . commands . registerCommand ( 'vscode-objectscript.superclass' , superclass ) ,
134
136
vscode . commands . registerCommand ( 'vscode-objectscript.touchBar.viewOthers' , viewOthers ) ,
135
137
vscode . commands . registerCommand ( 'vscode-objectscript.explorer.refresh' , ( ) => explorerProvider . refresh ( ) ) ,
136
138
vscode . commands . registerCommand ( 'vscode-objectscript.explorer.openClass' , vscode . window . showTextDocument ) ,
Original file line number Diff line number Diff line change 86
86
"command" : " vscode-objectscript.subclass" ,
87
87
"when" : " vscode-objectscript.connectActive"
88
88
},
89
+ {
90
+ "command" : " vscode-objectscript.superclass" ,
91
+ "when" : " vscode-objectscript.connectActive"
92
+ },
89
93
{
90
94
"command" : " vscode-objectscript.previewXml" ,
91
95
"when" : " vscode-objectscript.connectActive"
285
289
{
286
290
"category" : " ObjectScript" ,
287
291
"command" : " vscode-objectscript.subclass" ,
288
- "title" : " View subclasses"
292
+ "title" : " Go to Subclass..."
293
+ },
294
+ {
295
+ "category" : " ObjectScript" ,
296
+ "command" : " vscode-objectscript.superclass" ,
297
+ "title" : " Go to Super class..."
289
298
},
290
299
{
291
300
"command" : " vscode-objectscript.touchBar.compile" ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export class ClassDefinition {
10
10
constructor ( className : string ) {
11
11
if ( className . endsWith ( '.cls' ) ) {
12
12
className = className . replace ( / \. c l s $ / i, '' ) ;
13
- }
13
+ }
14
14
this . _className = ClassDefinition . normalizeClassName ( className , false ) ;
15
15
this . _classFileName = ClassDefinition . normalizeClassName ( className , true ) ;
16
16
}
@@ -33,6 +33,20 @@ export class ClassDefinition {
33
33
return api . actionIndex ( [ this . _classFileName ] ) . then ( data => getMethods ( data . result . content ) ) ;
34
34
}
35
35
36
+ async super ( ) : Promise < string [ ] > {
37
+ const api = new AtelierAPI ( ) ;
38
+ let sql = `SELECT PrimarySuper FROM %Dictionary.CompiledClass WHERE Name = ?` ;
39
+ return api
40
+ . actionQuery ( sql , [ this . _className ] )
41
+ . then ( data =>
42
+ data . result . content . reduce (
43
+ ( list : string [ ] , el : { PrimarySuper : string } ) =>
44
+ list . concat ( el . PrimarySuper . split ( '~' ) . filter ( el => el . length ) ) ,
45
+ [ ]
46
+ )
47
+ ) ;
48
+ }
49
+
36
50
async includeCode ( ) : Promise < string [ ] > {
37
51
const api = new AtelierAPI ( ) ;
38
52
let sql = `SELECT LIST(IncludeCode) List FROM %Dictionary.CompiledClass WHERE Name %INLIST (
You can’t perform that action at this time.
0 commit comments