Skip to content

Commit

Permalink
Insert item (microsoft#589)
Browse files Browse the repository at this point in the history
* Added icons for 6 new resource types in JsonOutlineProvider

* Fixed icon for resource type config

* Changed icon for "config" resource type

* Added icon for functions. Refactored and improved icon tests.

* Added test for current icons for functions in Treeview

* TreeView now shows icons for functions on 6 levels

* Treeview uses namespace as label if name and displayName is not present

* Fixed bug when getting icons for a function without parameters

* Updating TreeView after setting language to arm-template.

* Start of insertItem

* First working implementation of "Insert parameter"

* Todo for insert parameter

* Changed to template literal

* Added possibility to specify default value and description of parameter

* Handle case when there is no parameters before

* Initial support for 'Insert variable'

* InsertVariable sets the cursor position in the variable value

* insertVariable now scrolls to cursor if needed

* Implemented Insert Output

* Start of insert function

* Improved insert function

* Implemented Insert Resource

* Added spaces to all 'Insert xxx'
changed so that all items in TreeView has the same context as the root Item.

* Refactor insertParameter

* Refactoring of insertItem

* Refactored Insert Function

* Introduced types and fixed warnings in insertItem.ts

* Small fix for output value

* Started writing unit test for Insert Variable

* First passing test for Insert Variable

* Testing insert variable with different settings

* Minimized template to test

* Improved tests for Insert Variable

* Added tests for Insert Output

* Added tests that variables and outputs can be added to {}

* Added tests for parameters

* Added unit tests for Insert Function

* Added one unit test for InsertResource

* Added test that verifies all snippets used by Insert Resource

* Improved tests for Insert Resource

* Added error and information messages

* Cleanup of code

* Merge from master

* Fixed ending of merged files

* Fixed white space changes in AzureRMTools.ts

* Fix lint error

* Trying commenting failing test

* Testing resource snippets used by Insert Resource in multiple tests

* Changes based on feedback on PR

* Renamed SortType to TemplateSectionType

* Refactored getContextValue in Treeview

* Fixed failing unit tests

* Changed so that insertItem.getResourceSnippets reads
available resource snippets from assets/armsnippets.jsonc

* Removed unused function testResourceSnippet in insertItem.test.ts

* Changes to package.json based on feedback on PR

* Moved TemplateSectionType to separate file

* Throw error instead of show error message in insertItem

* Fixed indentation function

* Made changes based on feedback on PR

* Minor changes based on feedback on PR

* Fixed compilation error

Co-authored-by: Nils Hedström <[email protected]>
  • Loading branch information
nilshedstrom and Nils Hedström authored May 4, 2020
1 parent ecc1ffc commit 99c5a10
Show file tree
Hide file tree
Showing 12 changed files with 1,327 additions and 59 deletions.
2 changes: 2 additions & 0 deletions extension.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export { HoverInfo } from "./src/Hover";
export { httpGet } from './src/httpGet';
export { DefinitionKind, INamedDefinition } from "./src/INamedDefinition";
export { IncorrectArgumentsCountIssue } from "./src/IncorrectArgumentsCountIssue";
export { InsertItem } from "./src/insertItem";
export { IParameterDefinition } from "./src/IParameterDefinition";
export * from "./src/Language";
export { LanguageServerState } from "./src/languageclient/startArmLanguageServer";
Expand All @@ -62,6 +63,7 @@ export { containsArmSchema, getPreferredSchema, isArmSchema } from './src/schema
export * from "./src/survey";
export { TemplatePositionContext } from "./src/TemplatePositionContext";
export { ScopeContext, TemplateScope } from "./src/TemplateScope";
export { TemplateSectionType } from "./src/TemplateSectionType";
export { FunctionSignatureHelp } from "./src/TLE";
export { JsonOutlineProvider, shortenTreeLabel } from "./src/Treeview";
export { UnrecognizedBuiltinFunctionIssue, UnrecognizedUserFunctionIssue, UnrecognizedUserNamespaceIssue } from "./src/UnrecognizedFunctionIssues";
Expand Down
3 changes: 3 additions & 0 deletions icons/insertItemDark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/insertItemLight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions icons/sortDark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions icons/sortLight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 99c5a10

Please sign in to comment.