File tree 4 files changed +29
-2
lines changed
src/services/completion/providers
test/unit/services/completion
vscode-ui5-language-assistant 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @ui5-language-assistant/vscode-ui5-language-assistant-bas-ext " : patch
3
+ " vscode-ui5-language-assistant " : patch
4
+ " @ui5-language-assistant/binding " : patch
5
+ ---
6
+
7
+ No code completion for wrong position
Original file line number Diff line number Diff line change 1
1
import {
2
2
parseBinding ,
3
3
BindingParserTypes as BindingTypes ,
4
- positionContained ,
4
+ rangeContained ,
5
5
} from "@ui5-language-assistant/binding-parser" ;
6
6
import type { Position } from "vscode-languageserver-types" ;
7
7
import { AttributeValueCompletionOptions } from "@xml-tools/content-assist" ;
@@ -90,7 +90,10 @@ export function propertyBindingInfoSuggestions({
90
90
}
91
91
const cursorPos = context . textDocumentPosition ?. position ;
92
92
const binding = ast . bindings . find (
93
- ( b ) => cursorPos && positionContained ( b . range , cursorPos )
93
+ ( b ) =>
94
+ cursorPos &&
95
+ b . range &&
96
+ rangeContained ( b . range , { start : cursorPos , end : cursorPos } )
94
97
) ;
95
98
if ( ! binding ) {
96
99
continue ;
Original file line number Diff line number Diff line change @@ -141,6 +141,14 @@ describe("index", () => {
141
141
result . map ( ( item ) => completionItemToSnapshot ( item , true ) )
142
142
) . toStrictEqual ( [ ] ) ;
143
143
} ) ;
144
+ it ( "provides no CC on wrong position" , async function ( ) {
145
+ const snippet = `
146
+ <Input maxLength="${ CURSOR_ANCHOR } {path: ''}"/>` ;
147
+ const result = await getCompletionResult ( snippet ) ;
148
+ expect (
149
+ result . map ( ( item ) => completionItemToSnapshot ( item , true ) )
150
+ ) . toStrictEqual ( [ ] ) ;
151
+ } ) ;
144
152
it ( "provides no CC for metadata binding" , async function ( ) {
145
153
const snippet = `
146
154
<Input maxLength="{/#Company${ CURSOR_ANCHOR } /ZipCode/@maxLength}"/>` ;
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ The feature is available in the following:
50
50
- metaPath values in building blocks
51
51
- contextPath values for Chart building blocks
52
52
- filterBar values from the current file in building blocks
53
+ - property binding info when possible
53
54
54
55
### XML View Validations
55
56
@@ -73,6 +74,14 @@ and cannot be configured by the end user.
73
74
- Wrong cardinality of aggregation
74
75
- Wrong type of tags inside aggregations
75
76
- Missing or empty ID when ` flexEnabled ` is true (stableID)
77
+ - property binding info
78
+ - missing key
79
+ - missing or extra colon(s)
80
+ - missing or wrong value
81
+ - missing or extra comma(s)
82
+ - duplicate keys
83
+ - unknown key or char(s)
84
+ - recursive composite bindings
76
85
77
86
- Warnings:
78
87
You can’t perform that action at this time.
0 commit comments