-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support hover on the resource def to show the doc
- Loading branch information
Showing
6 changed files
with
202 additions
and
13 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
20 changes: 20 additions & 0 deletions
20
internal/langserver/handlers/testdata/TestHover_identity/expect.json
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,20 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 3, | ||
"result": { | ||
"contents": { | ||
"kind": "markdown", | ||
"value": "```\ntype: Required(string)\n```\nThe Type of Identity which should be used for this azure resource. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`." | ||
}, | ||
"range": { | ||
"start": { | ||
"line": 6, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"character": 8 | ||
} | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
internal/langserver/handlers/testdata/TestHover_identity/main.tf
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,23 @@ | ||
resource "azapi_resource" "cluster" { | ||
type = "Microsoft.ContainerService/managedClusters@2024-02-01" | ||
parent_id = azapi_resource.resourceGroup.id | ||
name = "example" | ||
location = azapi_resource.resourceGroup.location | ||
identity { | ||
type = "SystemAssigned" | ||
identity_ids = [] | ||
} | ||
body = { | ||
properties = { | ||
agentPoolProfiles = [ | ||
{ | ||
count = 1 | ||
mode = "System" | ||
name = "default" | ||
vmSize = "Standard_DS2_v2" | ||
}, | ||
] | ||
dnsPrefix = "example" | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
internal/langserver/handlers/testdata/TestHover_resource_title/expect.json
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,20 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 3, | ||
"result": { | ||
"contents": { | ||
"kind": "markdown", | ||
"value": "resource azapi_resource.test 'Microsoft.DataFactory/factories@2018-06-01' \n[View Documentation](https://learn.microsoft.com/en-us/azure/templates/microsoft.datafactory/factories?pivots=deployment-language-terraform)" | ||
}, | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 34 | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
internal/langserver/handlers/testdata/TestHover_resource_title/main.tf
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,17 @@ | ||
resource "azapi_resource" "test" { | ||
name = "acctest1774" | ||
parent_id = azurerm_batch_account.test.id | ||
type = "Microsoft.DataFactory/factories@2018-06-01" | ||
body = jsonencode({ | ||
identity = { | ||
type = "SystemAssigned" | ||
} | ||
properties = { | ||
encryption = { | ||
identity = { | ||
|
||
} | ||
} | ||
} | ||
}) | ||
} |