brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Error trying to open an inline editor in an untitled document #4151

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by gruehle Tuesday Jul 16, 2013 at 20:18 GMT Originally opened as https://github.com/adobe/brackets/issues/4481


Steps to repro

  1. Launch Brackets and load the brackets source
  2. Create a new, untitled document
  3. Enter some JavaScript. I used:
function blah() {
    DocumentManager.getCurrentDocument();
}
  1. Put your cursor in the name of a function that is defined in another file (like getCurrentDocument) and press Cmd-E.

Results Inline editor is not opened, and an error is output to the console:

Uncaught TypeError: Cannot call method 'getCursor' of null 
core-ai-bot commented 3 years ago

Comment by gruehle Tuesday Jul 16, 2013 at 20:19 GMT


To@iwehrman, medium priority for Sprint 28.

core-ai-bot commented 3 years ago

Comment by iwehrman Tuesday Jul 16, 2013 at 20:25 GMT


Stop breaking my features,@gruehle!

core-ai-bot commented 3 years ago

Comment by iwehrman Tuesday Jul 16, 2013 at 20:45 GMT


In the original code for untitled documents the default extension was .txt. This was done to ensure that untitled documents would be created in text mode, and as a consequence to avoid having to either update the JS hinter to cope with these weird documents or to disable code that reaches into the JS hinter on their behalf. This still seems like the right thing to do. AFAIK, it was only changed to .js for consistency with New File In Project. (I don't really think it makes much sense for any new documents or files to have a .js extension by default, but that's another story.)

I can certainly disable QuickEdit on untitled JavaScript files, but now I notice that it also needs to be disabled on Jump To Definition and possibly elsewhere. Unfortunately I haven't yet found a clean entry point from which to disable everything at once related to JS hinting for untitled documents. So, without further research, I'm looking at adding at least two more hacky tests in fairly arbitrary parts of the code to short circuit these commands.

My preference is still clearly for untitled documents to not be in JavaScript mode. Any thoughts on this? Will you let me change both untitled documents and new files to have a .txt extension and back out the existing incomplete hacks to turn off JS hinting in untitled documents?

CC@peterflynn

core-ai-bot commented 3 years ago

Comment by peterflynn Thursday Jul 18, 2013 at 00:16 GMT


FBNC@gruehle

core-ai-bot commented 3 years ago

Comment by gruehle Thursday Jul 18, 2013 at 17:09 GMT


Confirmed, closing.