File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "caption" : " C# WebForms: Open CodeBehind/CodeFile" ,
4+ "command" : " open_code_file_from_front_end" ,
5+ },
6+ ]
Original file line number Diff line number Diff line change @@ -61,6 +61,16 @@ contexts:
6161 4 : punctuation.definition.string.begin.cs-webforms
6262 5 : punctuation.definition.string.end.cs-webforms
6363
64+ directive-codefile-attribute :
65+ - match : \b(CodeBehind|CodeFile)\s*(?:(=)\s*((")([^"]*)("))?)?\s*
66+ captures :
67+ 1 : entity.other.attribute-name.cs-webforms
68+ 2 : punctuation.separator.key-value.cs-webforms
69+ 3 : string.quoted.double.cs-webforms
70+ 4 : punctuation.definition.string.begin.cs-webforms
71+ 5 : meta.path.codefile.cs-webforms
72+ 6 : punctuation.definition.string.end.cs-webforms
73+
6474 directive-end :
6575 - match : ' {{csharp_tag_end}}'
6676 scope : punctuation.section.embedded.end.cs-webforms
Original file line number Diff line number Diff line change @@ -19,5 +19,6 @@ contexts:
1919 scope : constant.language.processing-directive.cs-webforms entity.name.class.cs
2020 set :
2121 - meta_scope : meta.block.processing-directive.contents.type.cs-webforms
22+ - include : directive-codefile-attribute
2223 - include : directive-generic-attribute
2324 - include : directive-end
Original file line number Diff line number Diff line change @@ -19,5 +19,6 @@ contexts:
1919 scope : constant.language.processing-directive.cs-webforms entity.name.class.cs
2020 set :
2121 - meta_scope : meta.block.processing-directive.contents.type.cs-webforms
22+ - include : directive-codefile-attribute
2223 - include : directive-generic-attribute
2324 - include : directive-end
Original file line number Diff line number Diff line change @@ -19,5 +19,6 @@ contexts:
1919 scope : constant.language.processing-directive.cs-webforms entity.name.class.cs
2020 set :
2121 - meta_scope : meta.block.processing-directive.contents.type.cs-webforms
22+ - include : directive-codefile-attribute
2223 - include : directive-generic-attribute
2324 - include : directive-end
Original file line number Diff line number Diff line change 1+ import sublime
2+ import sublime_plugin
3+
4+
5+ class OpenCodeFileFromFrontEndCommand (sublime_plugin .TextCommand ):
6+ """Open foo.ascx.cs from foo.ascx"""
7+
8+ def is_enabled (self ):
9+ if ((self .view .match_selector (0 , 'text.html.cs.webforms' )
10+ and self .view .find_by_selector ('meta.path.codefile' ))):
11+ return True
12+ return False
13+
14+ def run (self , edit ):
15+ region = self .view .find_by_selector ('meta.path.codefile' )[0 ]
16+ codefile = self .view .substr (region )
17+ self .view .window ().open_file (str (codefile ))
You can’t perform that action at this time.
0 commit comments