MCPcopy Create free account
hub / github.com/docker/docker-language-server / TestCompletion_Schema

Function TestCompletion_Schema

internal/compose/completion_test.go:994–2886  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

992}
993
994func TestCompletion_Schema(t *testing.T) {
995 testCases := []struct {
996 name string
997 content string
998 line uint32
999 character uint32
1000 list *protocol.CompletionList
1001 }{
1002 {
1003 name: "top level node suggestions",
1004 content: `
1005configs:
1006 test:
1007`,
1008 line: 3,
1009 character: 0,
1010 list: &protocol.CompletionList{
1011 Items: topLevelNodes,
1012 },
1013 },
1014 {
1015 name: "top level node suggestions with a space in the front",
1016 content: ` `,
1017 line: 0,
1018 character: 1,
1019 list: &protocol.CompletionList{
1020 Items: topLevelNodes,
1021 },
1022 },
1023 {
1024 name: "top level node suggestions with indented content but code completion is unindented",
1025 content: `
1026 configs:
1027 test:
1028`,
1029 line: 3,
1030 character: 0,
1031 list: nil,
1032 },
1033 {
1034 name: "top level node suggestions with indented content and code completion is aligned correctly",
1035 content: `
1036 configs:
1037 test:
1038 `,
1039 line: 3,
1040 character: 1,
1041 list: &protocol.CompletionList{
1042 Items: topLevelNodes,
1043 },
1044 },
1045 {
1046 name: "alignment correct with multiple documents",
1047 content: `
1048---
1049---
1050 configs:
1051 test:

Callers

nothing calls this directly

Calls 10

CreateStringPointerFunction · 0.92
NewDocumentManagerFunction · 0.92
NewComposeDocumentFunction · 0.92
textEditFunction · 0.85
servicePropertiesFunction · 0.85
serviceBuildPropertiesFunction · 0.85
CompletionFunction · 0.70
URIMethod · 0.65

Tested by

no test coverage detected