-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added support to C#, JSON (#25) * 1.0.18 * 1.0.18 * 1.0.18 Co-authored-by: Igor Moskalenko <[email protected]>
- Loading branch information
Showing
12 changed files
with
71 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'prismjs/components/prism-csharp'; | ||
import {CLikeTokenFactory} from './clike' | ||
import {DOM} from "../../config"; | ||
|
||
class CSharpTokenFactory extends CLikeTokenFactory { | ||
create(name: String, className: string): Node | false | null { | ||
const result = super.create(name, className); | ||
if (result !== null) { | ||
return result; | ||
} | ||
switch (name) { | ||
case 'namespace': | ||
case 'generics': | ||
case 'annotation': | ||
case 'constructor-invocation': | ||
case 'return-type': | ||
return DOM.createElement('span', className); | ||
default: | ||
return null; | ||
} | ||
} | ||
} | ||
|
||
export const csharp = new CSharpTokenFactory(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import 'prismjs/components/prism-typescript'; | ||
import 'prismjs/components/prism-json'; | ||
|
||
import { csharp } from './csharp' | ||
import { gherkin } from './gherkin' | ||
import { java } from './java' | ||
import { javascript } from './javascript' | ||
import { gherkin } from './gherkin' | ||
|
||
export const factories = new Map<String, TokenFactory>(); | ||
factories.set('csharp', csharp); | ||
factories.set('gherkin', gherkin); | ||
factories.set('java', java); | ||
factories.set('js', javascript); | ||
factories.set('ts', javascript); | ||
factories.set('gherkin', gherkin); | ||
factories.set('json', javascript); | ||
factories.set('ts', javascript); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import mainData from '../../resources/icons/main.svg' | ||
import csharp from '../../resources/icons/csharp.svg' | ||
import javaData from '../../resources/icons/java.svg' | ||
import jsData from '../../resources/icons/js.svg' | ||
import jsonData from '../../resources/icons/json.svg' | ||
import tsData from '../../resources/icons/ts.svg' | ||
import cucumberData from '../../resources/icons/cucumber.svg' | ||
import {LanguageDescription} from "../settings/shared-settings"; | ||
|
||
export const mainIcon = mainData; | ||
export const langKey2IconData: Map<string, string> = new Map([ | ||
['csharp', csharp], | ||
['gherkin', cucumberData], | ||
['java', javaData], | ||
['js', jsData], | ||
['ts', tsData], | ||
['gherkin', cucumberData] | ||
['json', jsonData], | ||
['ts', tsData] | ||
]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters