-
Notifications
You must be signed in to change notification settings - Fork 24
Moving to TS #47
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
Open
elazarcoh
wants to merge
23
commits into
jgclark:master
Choose a base branch
from
elazarcoh:to-ts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Moving to TS #47
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b40d370
delete compiled files from repository
elazarcoh a6afe15
init
elazarcoh e631dbb
change Style to DecorationRenderOptions
elazarcoh 93b79d7
make configurations more sensible
elazarcoh 6b22074
Correct small typo on README.md
jonz94 3b8805c
Bump terser from 5.7.2 to 5.14.2
dependabot[bot] 2fa1ffa
Merge pull request #53 from jgclark/dependabot/npm_and_yarn/terser-5.…
jgclark 01e5ae3
Bump nth-check from 2.0.0 to 2.1.1
dependabot[bot] fcab1bf
Bump ansi-regex from 3.0.0 to 3.0.1
dependabot[bot] 40c1bd0
Merge pull request #55 from jgclark/dependabot/npm_and_yarn/ansi-rege…
jgclark e45e20b
Merge pull request #54 from jgclark/dependabot/npm_and_yarn/nth-check…
jgclark 1923482
creates diagnostics for open files
farwyler bf54e46
Merge pull request #58 from farwyler/enable-diagnostics
jgclark 700c865
Bump nanoid and mocha
dependabot[bot] 06d929f
Bump markdown-it and vsce
dependabot[bot] be55281
Followup: Fix wrong syntax
alkatar21 7f11abb
Merge pull request #60 from jgclark/dependabot/npm_and_yarn/nanoid-an…
jgclark 9354cfa
Merge pull request #61 from jgclark/dependabot/npm_and_yarn/markdown-…
jgclark a75054a
Merge pull request #51 from jonz94/master
jgclark a523a5f
Merge pull request #62 from alkatar21/patch-1
jgclark db9898b
Merge pull request #46 from elazarcoh/master
jgclark 98cabca
Merge branch 'to-ts'
elazarcoh 4e1b4aa
update config
elazarcoh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,22 @@ | ||
| // A launch configuration that compiles the extension and then opens it inside a new window | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Run Extension", | ||
| "type": "extensionHost", | ||
| "request": "launch", | ||
| "runtimeExecutable": "${execPath}", | ||
| "args": [ | ||
| "--extensionDevelopmentPath=${workspaceFolder}", | ||
| ], | ||
| "outFiles": [ | ||
| "${workspaceFolder}/dist/**/*.js" | ||
| ], | ||
| "preLaunchTask": "npm: webpack" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,10 @@ | ||
| // Place your settings in this file to overwrite default and user settings. | ||
| { | ||
| "files.exclude": { | ||
| "out": false // set this to true to hide the "out" folder with the compiled JS files | ||
| }, | ||
| "search.exclude": { | ||
| "out": true // set this to false to include "out" folder in search results | ||
| }, | ||
| "npm.packageManager": "npm", | ||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,151 @@ | ||
| import { ConfigurationScope, ConfigurationTarget, workspace } from 'vscode'; | ||
|
|
||
| type InspectReturnValue<C extends { [key: string]: any }, K extends keyof C> = { | ||
| key: string; | ||
| defaultValue?: C[K]; | ||
| globalValue?: C[K]; | ||
| workspaceValue?: C[K]; | ||
| workspaceFolderValue?: C[K]; | ||
| defaultLanguageValue?: C[K]; | ||
| globalLanguageValue?: C[K]; | ||
| workspaceLanguageValue?: C[K]; | ||
| workspaceFolderLanguageValue?: C[K]; | ||
| languageIds?: string[]; | ||
| }; | ||
|
|
||
| export function ConfigurationGetter<C extends { [key: string]: any }>( | ||
| section: string | ||
| ) { | ||
| return <K extends keyof C>( | ||
| subsection: K, | ||
| scope?: ConfigurationScope | null, | ||
| defaultValue?: C[K] | ||
| ) => { | ||
| const config = workspace.getConfiguration(section, scope); | ||
| // @ts-expect-error subsection is always of type string, though the compiler doesn't see it | ||
| return config.get<C[K] | undefined>(subsection, defaultValue); | ||
| }; | ||
| } | ||
|
|
||
| export function ConfigurationInspector<C extends { [key: string]: any }>( | ||
| section: string | ||
| ) { | ||
| return <K extends keyof C>( | ||
| subsection: K, | ||
| scope?: ConfigurationScope | null | ||
| ): InspectReturnValue<C, K> => { | ||
| const config = workspace.getConfiguration(section, scope); | ||
| // @ts-expect-error subsection is always of type string, though the compiler doesn't see it | ||
| return config.inspect(subsection); | ||
| }; | ||
| } | ||
|
|
||
| export function ConfigurationSetter<C extends { [key: string]: any }>( | ||
| section: string | ||
| ) { | ||
| return <K extends keyof C>( | ||
| subsection: K, | ||
| value: C[K], | ||
| scope?: ConfigurationScope | null, | ||
| configurationTarget?: boolean | ConfigurationTarget | null, | ||
| overrideInLanguage?: boolean | ||
| ) => { | ||
| const config = workspace.getConfiguration(section, scope); | ||
| return config.update( | ||
| // @ts-expect-error subsection is always of type string, though the compiler doesn't see it | ||
| subsection, | ||
| value, | ||
| configurationTarget, | ||
| overrideInLanguage | ||
| ); | ||
| }; | ||
| } | ||
|
|
||
| interface IGet<C extends { [key: string]: any }> { | ||
| get<K extends keyof C>( | ||
| subsection: K, | ||
| scope?: ConfigurationScope | null | ||
| ): C[K] | undefined; | ||
| get<K extends keyof C>( | ||
| subsection: K, | ||
| scope: ConfigurationScope | null | undefined, | ||
| defaultValue: C[K] | ||
| ): C[K]; | ||
| } | ||
|
|
||
| interface IInspect<C extends { [key: string]: any }> { | ||
| inspect<K extends keyof C>( | ||
| subsection: K | ||
| ): InspectReturnValue<C, K> | undefined; | ||
| } | ||
|
|
||
| interface IUpdate<C extends { [key: string]: any }> { | ||
| update<K extends keyof C>( | ||
| subsection: K, | ||
| value: C[K], | ||
| scope?: ConfigurationScope, | ||
| configurationTarget?: boolean | ConfigurationTarget, | ||
| overrideInLanguage?: boolean | ||
| ): Thenable<void>; | ||
| } | ||
|
|
||
| export class VSCodeConfigurations<C extends { [key: string]: any }> | ||
| implements IGet<C>, IUpdate<C>, IInspect<C> | ||
| { | ||
| private _get: <K extends keyof C>( | ||
| subsection: K, | ||
| scope?: ConfigurationScope | null, | ||
| defaultValue?: C[K] | ||
| ) => C[K] | undefined; | ||
| private _inspect: <K extends keyof C>( | ||
| subsection: K | ||
| ) => InspectReturnValue<C, K>; | ||
| private _update: <K extends keyof C>( | ||
| subsection: K, | ||
| value: C[K], | ||
| scope?: ConfigurationScope | null, | ||
| configurationTarget?: boolean | ConfigurationTarget | null, | ||
| overrideInLanguage?: boolean | ||
| ) => Thenable<void>; | ||
|
|
||
| constructor(readonly section: string) { | ||
| this._get = ConfigurationGetter<C>(section); | ||
| this._update = ConfigurationSetter<C>(section); | ||
| this._inspect = ConfigurationInspector<C>(section); | ||
| } | ||
|
|
||
| update<K extends keyof C>( | ||
| subsection: K, | ||
| value: C[K], | ||
| scope?: ConfigurationScope, | ||
| configurationTarget?: boolean | ConfigurationTarget, | ||
| overrideInLanguage?: boolean | ||
| ): Thenable<void> { | ||
| return this._update( | ||
| subsection, | ||
| value, | ||
| scope, | ||
| configurationTarget, | ||
| overrideInLanguage | ||
| ); | ||
| } | ||
|
|
||
| inspect<K extends keyof C>( | ||
| subsection: K | ||
| ): InspectReturnValue<C, K> | undefined { | ||
| return this._inspect(subsection); | ||
| } | ||
|
|
||
| get<K extends keyof C>( | ||
| subsection: K, | ||
| scope?: ConfigurationScope | null | ||
| ): C[K] | undefined; | ||
| get<K extends keyof C>( | ||
| subsection: K, | ||
| scope: ConfigurationScope | null | undefined, | ||
| defaultValue: C[K] | ||
| ): C[K]; | ||
| get(subsection: any, scope?: any, defaultValue?: any) { | ||
| return this._get(subsection, scope, defaultValue); | ||
| } | ||
| } |
This file contains hidden or 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,93 @@ | ||
| import { ConfigurationScope, ConfigurationTarget, workspace } from 'vscode'; | ||
| import { VSCodeConfigurations } from './config-utils'; | ||
|
|
||
| export interface Style { | ||
| /** | ||
| * The background color for the highlight. | ||
| */ | ||
| backgroundColor?: string; | ||
| /** | ||
| * The border style for the highlight, as a CSS string. | ||
| */ | ||
| border?: string; | ||
| /** | ||
| * The text color. | ||
| */ | ||
| color?: string; | ||
| /** | ||
| * The style for the cursor shown over the highlight, as a CSS property. | ||
| */ | ||
| cursor?: string; | ||
| /** | ||
| * If true, then the whole line is highlighted, not just the matching text. | ||
| */ | ||
| isWholeLine?: boolean; | ||
| /** | ||
| * The color of the ruler mark on the scroll bar. | ||
| */ | ||
| overviewRulerColor?: string; | ||
| } | ||
|
|
||
| export interface TextKeyword extends Style { | ||
| /** | ||
| * Custom text to be highlighted. | ||
| */ | ||
| text: string; | ||
| } | ||
| export interface RegExpKeyword extends Style { | ||
| /** | ||
| * name of the regexp keyword. | ||
| */ | ||
| text: string; | ||
| regex: { | ||
| /** | ||
| * The RegEx pattern to use for matching instead of the text value. REMEMBER to escape any backslashes in your regexp (using \\ instead of single backslash). | ||
| */ | ||
| pattern: string; | ||
| }; | ||
| } | ||
|
|
||
| export type Keyword = TextKeyword | RegExpKeyword; | ||
|
|
||
| export interface TODOHighlightConfig { | ||
| /** | ||
| * Enable or disable the highlighting | ||
| */ | ||
| isEnable: boolean; | ||
| /** | ||
| * Specify whether the keywords are case sensitive or not | ||
| */ | ||
| isCaseSensitive: boolean; | ||
| /** | ||
| * If the file path within the output channel is not clickable, set this to true to toggle the path patten between `<path>#<line>` and `<path>:<line>:<column>` | ||
| */ | ||
| toggleURI: boolean; | ||
| /* | ||
| * An array of keywords, and their CSS to customise how they look. See all available properties in the [VSCode doc on DecorationRenderOptions](https://code.visualstudio.com/api/references/vscode-api#DecorationRenderOptions) section. | ||
| */ | ||
| keywords: (string | Keyword)[]; | ||
| /** | ||
| * Specify keywords via RegExp instead of `todohighlight.keywords` one by one. NOTE that if this present, `todohighlight.keywords` will be ignored. REMEMBER to escapse any backslashes in your regexp (using \\ instead of single backslash). | ||
| */ | ||
| keywordsPattern: string; | ||
| /** | ||
| * Default style for all customized keywords. See all available properties in the [VSCode doc on DecorationRenderOptions](https://code.visualstudio.com/api/references/vscode-api#DecorationRenderOptions) section. | ||
| */ | ||
| defaultStyle: Style; | ||
| /** | ||
| * Glob patterns that defines the files to search for. Only include files you need, DO NOT USE `{** /*.*}` for both performance and to avoid binary files. | ||
| */ | ||
| include: string[]; | ||
| /** | ||
| * Glob pattern that defines files and folders to exclude while listing annotations. | ||
| */ | ||
| exclude: string[]; | ||
| /** | ||
| * Max files for searching | ||
| */ | ||
| maxFilesForSearch: number; | ||
| } | ||
|
|
||
|
|
||
| const EXTENSION = 'todohighlight'; | ||
| export const configurations = new VSCodeConfigurations<TODOHighlightConfig>(EXTENSION); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.