Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Quick Edit shows no results if project contains ANY non-UTF8 CSS/LESS/SCSS files #8890

Open
core-ai-bot opened this issue Aug 30, 2021 · 17 comments

Comments

@core-ai-bot
Copy link
Member

Issue by nrennert
Tuesday Nov 25, 2014 at 02:53 GMT
Originally opened as adobe/brackets#10013


I'm using Win 7 Home/64bit. I've installed Brackets version 1.0 build 1.0.0-15191 twice; first time with no extensions, the second time it was a fresh install with Extract for Brackets installed. In both installs I tried to use the Ctrl+E, right-click and choose Quick Edit and tried the menu. In neither case did the function work. I did get it to work on a css file when I tried to change a color. In that case I used the Ctrl+E shortcut. I would love to use this feature; any help to figure out why it doesn't work would be great.
I tried using it on a bare bones html file with a very short and simple css file and it still didn't work.

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Tuesday Nov 25, 2014 at 02:57 GMT


@nrennert Did you use File > Open Folder to open the root folder of your file as the project root? If not, then you won't be able to use Quick Edit by just opening the file.

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Tuesday Nov 25, 2014 at 03:05 GMT


Yes, I opened the whole folder and then opened the file by double clicking on it in the File Tree view. The Live Preview works but not html file. Quick Edit does work in the css file though.

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Tuesday Nov 25, 2014 at 03:35 GMT


@nrennert Can you provide some sample HTML code with steps to reproduce so that we can understand what is not working for you?

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Tuesday Nov 25, 2014 at 03:42 GMT


I tried it on a super simple html page (saved to the same folder) and a super simple css file (saved to css/test.css) without success.
index.html =

<html>
<head>
    <link rel="stylesheet" href="css/test.css" type="text/css" />
</head>
    <body>
    <h1>This is a heading</h1>
    </body>
</html>

css file =

body {
 color: #3966ba;   
}

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Tuesday Nov 25, 2014 at 03:52 GMT


I corrected your html and css sample code and wrap them with three backticks to show them as code blocks. And I also try it by placing the cursor inside the body tag and Quick Edit is working for me. I see the CSS code show up in inline editor. Are you not seeing the inline editor?

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Tuesday Nov 25, 2014 at 04:59 GMT


no, I've tried it with several different files; several I'm working on and then I also created this very short and simple test file. Nothing has worked.

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Tuesday Nov 25, 2014 at 05:01 GMT


<html>
<head>
        <link rel="stylesheet" href="css/test.css" type="text/css" />
</head>
    <body>
    <h1>This is a heading</h1>
    </body>
</html>

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Tuesday Nov 25, 2014 at 06:36 GMT


@nrennert Can you take a screenshot that include left sidebar, menu and your cursor position in the html file so that we can see what went wrong with your testing? Below is a sample screenshot showing Quick Edit not working when I invoke it in the body tag of a not-yet-saved new file. Are you getting a message popup as in my screenshot?

quickedit1

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Tuesday Nov 25, 2014 at 06:49 GMT


Here is a screen shot of the simple html file with test.css.
test

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Tuesday Nov 25, 2014 at 20:18 GMT


@nrennert Can you open Developer Tools (Debug > Show Developer Tools) and look into Console tab? And tell us whether you see any errors or warnings in there.

You mentioned that Ctrl+E is working in CSS file for colors. Can you try one more thing in a CSS file by pressing Ctrl+T? See do you get a list pop up on the top right corner showing all the selectors in your css file?

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Tuesday Nov 25, 2014 at 21:52 GMT


Here is the screen shot of the console.
test

Here is the screen shot after pressing Ctr+t
test2

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Tuesday Nov 25, 2014 at 22:07 GMT


On another file of mine I get a lot more information on the console. This might help.
test3

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Nov 25, 2014 at 22:20 GMT


@nrennert Can you try this?

  1. Debug > Show Developer Tools in the menu
  2. Press Ctrl-O and type "CSSUtils"
  3. Go to line 1404 (search for _findMatchingRulesInCSSFiles and you should be close to it). This line should say oneFileResult.reject(error);. Once you find that line, click on the line number to add a breakpoint on that line.
  4. Back in Brackets, put your cursor on the <h1> tag and press Ctrl-E
  5. At this point Brackets will probably pause (and get covered with a dark gray tint). Go back to developer tools when this happens.
  6. In the console, type error -- what value does it print after you do that? If you can take a screenshot of the "Call Stack" panel in the "Sources" tab, that would be very helpful too. Thanks!

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Nov 25, 2014 at 23:38 GMT


If my read of this is correct, the issue is that CSSUtils._findMatchingRulesInCSSFiles() will fail if any one file is unreadable for some reason. In contrast, FindInFiles silently ignores errors while reading files.

So, we should make Quick Edit similarly robust to file IO errors. Although since we're filtering on file extension in this case, read errors are a little more unexpected (vs. FindInFiles where we could easily encounter binary files with unknown extensions) -- so I think in this case we should log a warning to the console instead of being 100% silent.

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Wednesday Nov 26, 2014 at 01:47 GMT


Here is the screen shot of the call stack. The error is "unsupportedEncoding". Could Brackets have a problem with files that are in utf8? All my files are in utf8, including the css files.
test4

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Wednesday Nov 26, 2014 at 02:02 GMT


Interesting. Can you share one of the utf-8 css files that is causing this failure?

@core-ai-bot
Copy link
Member Author

Comment by nrennert
Wednesday Nov 26, 2014 at 06:33 GMT


I've just tested the utf8 possibility and it does not make a difference. Even with the html and css file both being in ANSI my version of Brackets still doesn't have the Quick Edit function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant