File tree 6 files changed +32
-10
lines changed
6 files changed +32
-10
lines changed Original file line number Diff line number Diff line change 1
1
' atom-text-editor[data-grammar~=ts]' :
2
2
' alt-cmd-l' : ' typescript:format-code'
3
3
' alt-ctrl-l' : ' typescript:format-code'
4
- ' ctrl-shift-b' : ' typescript:build'
5
- ' cmd-shift-b' : ' typescript:build'
6
- ' ctrl-b' : ' typescript:go-to-declaration'
7
- ' cmd-b' : ' typescript:go-to-declaration'
8
4
' ctrl-;' : ' typescript:context-actions'
9
5
' cmd-;' : ' typescript:context-actions'
10
6
' f2' : ' typescript:rename-variable'
7
+
8
+ # Note that we are good citizens in our commands handling logic
9
+ # we will gladly hand off the command to something else if a ts file is not active
10
+ # That said :
11
+ # These need to be *platform specific* + on *body* to increase specifity + we need to have a menu item for these
12
+ # if we want them to override what atom has by default (find buffer / find modified file)
13
+ ' body.platform-win32, body.platform-linux' :
14
+ ' ctrl-shift-b' : ' typescript:build'
15
+ ' ctrl-b' : ' typescript:go-to-declaration'
16
+ ' body.platform-darwin' :
17
+ ' cmd-shift-b' : ' typescript:build'
18
+ ' cmd-b' : ' typescript:go-to-declaration'
19
+
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ function registerCommands() {
39
39
} ) ;
40
40
}
41
41
} ) ;
42
- atom . commands . add ( 'atom-text-editor ' , 'typescript:build' , function ( e ) {
42
+ atom . commands . add ( 'atom-workspace ' , 'typescript:build' , function ( e ) {
43
43
if ( ! commandForTypeScript ( e ) )
44
44
return ;
45
45
var editor = atom . workspace . getActiveTextEditor ( ) ;
@@ -68,7 +68,7 @@ function registerCommands() {
68
68
} ) ;
69
69
} ) ;
70
70
} ;
71
- atom . commands . add ( 'atom-text-editor ' , 'typescript:go-to-declaration' , handleGoToDeclaration ) ;
71
+ atom . commands . add ( 'atom-workspace ' , 'typescript:go-to-declaration' , handleGoToDeclaration ) ;
72
72
atom . commands . add ( 'atom-text-editor' , 'symbols-view:go-to-declaration' , handleGoToDeclaration ) ;
73
73
atom . commands . add ( 'atom-text-editor' , 'typescript:context-actions' , function ( e ) {
74
74
atom . notifications . addSuccess ( 'Context options coming soon!' ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export function registerCommands() {
52
52
53
53
}
54
54
} ) ;
55
- atom . commands . add ( 'atom-text-editor ' , 'typescript:build' , ( e ) => {
55
+ atom . commands . add ( 'atom-workspace ' , 'typescript:build' , ( e ) => {
56
56
if ( ! commandForTypeScript ( e ) ) return ;
57
57
58
58
var editor = atom . workspace . getActiveTextEditor ( ) ;
@@ -91,7 +91,7 @@ export function registerCommands() {
91
91
} ) ;
92
92
} ;
93
93
94
- atom . commands . add ( 'atom-text-editor ' , 'typescript:go-to-declaration' , handleGoToDeclaration ) ;
94
+ atom . commands . add ( 'atom-workspace ' , 'typescript:go-to-declaration' , handleGoToDeclaration ) ;
95
95
// This exists by default in the right click menu https://github.com/TypeStrong/atom-typescript/issues/96
96
96
atom . commands . add ( 'atom-text-editor' , 'symbols-view:go-to-declaration' , handleGoToDeclaration ) ;
97
97
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ var MainPanelView = (function (_super) {
29
29
} , text ) ;
30
30
} ;
31
31
this . div ( {
32
- class : 'am-panel tool-panel panel-bottom native-key-bindings' ,
32
+ class : 'am-panel tool-panel panel-bottom native-key-bindings atomts-main-panel ' ,
33
33
tabindex : '-1'
34
34
} , function ( ) {
35
35
_this . div ( {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export class MainPanelView extends view.View<any> {
28
28
} , text ) ;
29
29
30
30
this . div ( {
31
- class : 'am-panel tool-panel panel-bottom native-key-bindings' ,
31
+ class : 'am-panel tool-panel panel-bottom native-key-bindings atomts-main-panel ' ,
32
32
tabindex : '-1'
33
33
} , ( ) => {
34
34
this . div ( {
Original file line number Diff line number Diff line change
1
+ # See https://atom.io/docs/latest/creating-a-package#menus for more details
2
+ ' menu' : [
3
+ {
4
+ ' label' : ' Packages'
5
+ ' submenu' : [
6
+ ' label' : ' TypeScript'
7
+ ' submenu' : [
8
+ { ' label' : ' Build' , ' command' : ' typescript:build' }
9
+ { ' label' : ' Go To Declaration' , ' command' : ' typescript:go-to-declaration' }
10
+ ]
11
+ ]
12
+ }
13
+ ]
You can’t perform that action at this time.
0 commit comments