-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/issue 3972 #3989
Fix/issue 3972 #3989
Changes from 4 commits
6b3245d
77434ce
e0bfab1
695e52c
457ce3d
354c814
3f616e9
fcf18a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,10 +28,18 @@ export default function(hljs) { | |
"unknown" | ||
]; | ||
const NAMESPACE = { | ||
beginKeywords: 'namespace', | ||
begin: [ | ||
/namespace/, | ||
/\s+/, | ||
hljs.IDENT_RE | ||
], | ||
beginScope: { | ||
1: "keyword", | ||
3: "variable" | ||
}, | ||
end: /\{/, | ||
excludeEnd: true, | ||
contains: [ tsLanguage.exports.CLASS_REFERENCE ] | ||
contains: [tsLanguage.exports.CLASS_REFERENCE] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure we need any of this anymore - the match rule should be enough to highlight the keyword and namespace name... but should IDENT_RE used above to recognize namespace perhaps be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is the above change enough or i should change something else. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I was suggesting |
||
}; | ||
const INTERFACE = { | ||
beginKeywords: 'interface', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<span class="hljs-keyword">const</span> message = <span class="hljs-string">'foo'</span>; | ||
<span class="hljs-keyword">const</span> <span class="hljs-keyword">namespace</span> = <span class="hljs-string">'bar'</span>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't the desire behavior... We'll also need to remove it from |
||
<span class="hljs-keyword">function</span> <span class="hljs-title function_">baz</span>(<span class="hljs-params"></span>) {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const message = 'foo'; | ||
const namespace = 'bar'; | ||
function baz() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the examples (https://www.typescriptlang.org/docs/handbook/namespaces.html) it looks like namespaces are class-like and CamelCase in their naming... so I think
title.class
would be more appropriate here than variable.