(t *testing.T)
| 992 | } |
| 993 | |
| 994 | func 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: ` |
| 1005 | configs: |
| 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: |
nothing calls this directly
no test coverage detected