-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Replace the URL in URLCodeHints even if it is the current content of … #11284
Conversation
I can't remember exactly, but it was probably an attempt to prevent unnecessary work. |
In this case, this is a safe change. Right now, |
This seems like the right thing to do, but I haven't test the code. |
Seems to fix the issue for me. Maybe add a test? |
Spoke too soon: now I see an error on the console: .test {
color: red;
background-image: url(index.htm
} If I try to autocomplete the url (should be |
Strange. I can't repro your recipe. |
Also, I've just added a test case. |
Awesome!
Sorry, the test is an HTML file. The following should suffix to reproduce. <html>
<head>
</head>
<body>
<style type="text/css">
.test {
color: red;
background-image: url(index.htm
}
</style>
</body>
</html> Sometime I can see the following exception too. It's about Exception in 'editorChange' listener on Editor {document: Document, _handleDocumentChange: function, _handleDocumentDeleted: function, _handleDocumentLanguageChanged: function, _doWorkingSetSync: function…} TypeError: Cannot read property 'localState' of undefined TypeError: Cannot read property 'localState' of undefined
at _getContextState (file:///C:/Program%20Files%20(x86)/Brackets/dev/src/language/CSSUtils.js:95:51)
at _isInPropValue (file:///C:/Program%20Files%20(x86)/Brackets/dev/src/language/CSSUtils.js:138:21)
at _getSucceedingPropValues (file:///C:/Program%20Files%20(x86)/Brackets/dev/src/language/CSSUtils.js:355:18)
at _getRuleInfoStartingFromPropValue (file:///C:/Program%20Files%20(x86)/Brackets/dev/src/language/CSSUtils.js:505:40)
at Object.getInfoAtPos (file:///C:/Program%20Files%20(x86)/Brackets/dev/src/language/CSSUtils.js:623:20)
at UrlCodeHints.hasCssHints (file:///C:/Program%20Files%20(x86)/Brackets/dev/src/extensions/default/UrlCodeHints/main.js:293:30)
at UrlCodeHints.hasHints (file:///C:/Program%20Files%20(x86)/Brackets/dev/src/extensions/default/UrlCodeHints/main.js:267:25)
at file:///C:/Program%20Files%20(x86)/Brackets/dev/src/editor/CodeHintManager.js:486:31
at Array.some (native)
at _beginSession (file:///C:/Program%20Files%20(x86)/Brackets/dev/src/editor/CodeHintManager.js:485:26) |
Running |
@ficristo I've seen a failure in one run ( |
I see other test failures but they seem unrelated. |
91640c7
to
90c878c
Compare
Thanks for reviewing, @ficristo :) |
…the attr
Fixes #11087. Turns out we already do what @redmunds described in his comment, but only if the hinted file name is not equal to the current value.
@redmunds It looks like you added this extra condition on purpose. Do you recall on why you did that? Was there a specific case which this was supposed to fix?
cc @redmunds