Closed
Bug 1001150
Opened 12 years ago
Closed 6 years ago
Add a Mode menu to provide JavaScript and Plain Text modes to Scratchpad
Categories
(DevTools Graveyard :: Scratchpad, enhancement, P3)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: rcampbell, Unassigned)
Details
(Whiteboard: [good first bug][lang=js,xul])
Attachments
(6 files)
|
3.78 KB,
patch
|
Details | Diff | Splinter Review | |
|
6.35 KB,
patch
|
rcampbell
:
feedback+
|
Details | Diff | Splinter Review |
|
21.57 KB,
application/octet-stream
|
Details | |
|
7.04 KB,
patch
|
Details | Diff | Splinter Review | |
|
4.60 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.24 KB,
patch
|
Details | Diff | Splinter Review |
We should be able to select syntax highlighting modes from a toolbar button in the Scratchpad.
Comment 1•12 years ago
|
||
Note that this dropdown should also probably be disabled when we decide the source file is too long to efficiently syntax highlight and still provide a good user experience.
Might want to add a tooltip to notify the user as to why we did that too.
Comment 2•12 years ago
|
||
Hi Rob,
Comment 3•12 years ago
|
||
Hi Rob,
I would like to work on this bug, however i am newbie to mozilla can you help me get started on this one?
| Reporter | ||
Comment 4•12 years ago
|
||
aditya,
Please have a read through: https://wiki.mozilla.org/DevTools/Hacking
Get yourself setup and building, and we can proceed from there.
Comment 5•12 years ago
|
||
I might be misunderstanding the feature, but why would you need a dropdown to choose a file type? Couldn't you just autodetect?
| Reporter | ||
Comment 6•12 years ago
|
||
(In reply to terzicigor from comment #5)
> I might be misunderstanding the feature, but why would you need a dropdown
> to choose a file type? Couldn't you just autodetect?
In some cases. Most editors get that wrong though.
I think I'm morphing this bug after playing around with the built-in styles. What I really wanted was to just have a text mode for editing plaintext that turns off auto-indent and syntax highlighting (and now tern for autocomplete).
I have a work-in-progress patch here for experimentation if anyone wants to finish it.
| Reporter | ||
Updated•12 years ago
|
Summary: add a File Type dropdown to expose CodeMirror syntax modes → Add a Mode menu to provide JavaScript and Plain Text modes to Scratchpad
| Reporter | ||
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
I'm keen to take this on... Big fan of CM (and FireFox) :) and I've already been working with CM on other projects.
(In reply to Rob Campbell [:rc] (:robcee) from comment #6)
> I think I'm morphing this bug after playing around with the built-in styles.
> What I really wanted was to just have a text mode for editing plaintext that
> turns off auto-indent and syntax highlighting (and now tern for
> autocomplete).
Is there a use-case around specifically switching between JS and plain text, or is there a benefit to exposing the other modes in CM?
> I have a work-in-progress patch here for experimentation if anyone wants to
> finish it.
What is missing?
Flags: needinfo?(rcampbell)
Comment 9•12 years ago
|
||
Is this moving in the direction you were thinking? Disabling relevant capabilities of CM? Or are you hoping for something more visual to control options based on syntax?
Attachment #8439568 -
Flags: feedback?
Comment 10•12 years ago
|
||
Apologies for the whitespace issues in the diff - I'll be sure to rein in my Sublime settings for that :)
| Assignee | ||
Updated•12 years ago
|
Mentor: rcampbell
Whiteboard: [good-first-bug][mentor=robcee][lang=js,xul] → [good-first-bug][lang=js,xul]
Updated•12 years ago
|
Whiteboard: [good-first-bug][lang=js,xul] → [good first bug][lang=js,xul]
| Reporter | ||
Comment 11•12 years ago
|
||
Comment on attachment 8439568 [details] [diff] [review]
plaintextscratchpad.patch
Review of attachment 8439568 [details] [diff] [review]:
-----------------------------------------------------------------
yup. This is pretty close to what I had in a test patch so I think it looks good. :)
I'd like to figure out how to disable Tern for JS autocompletion in text mode, but would also consider doing that in a followup bug.
We should have a test for text mode as well where we can verify some of these mode settings.
Attachment #8439568 -
Flags: feedback? → feedback+
| Reporter | ||
Comment 12•12 years ago
|
||
looks good, Dustin. Thanks for the patch and sorry for the delay. I'm back online now if you have any questions.
Flags: needinfo?(rcampbell)
| Reporter | ||
Updated•12 years ago
|
Assignee: nobody → dustin
Status: NEW → ASSIGNED
No updates in many months, unassigning.
Assignee: dustin → nobody
Status: ASSIGNED → NEW
Mentor: rcampbell → nfitzgerald
Updated•10 years ago
|
Mentor: nfitzgerald
Comment 14•10 years ago
|
||
Hi, I'm new to firefox developping and I am looking for a bug to patch first. Can I work on this one ?
Comment 15•10 years ago
|
||
Hi, I am looking forward to work on this bug. Can you help me out to get started. I have already gone through https://wiki.mozilla.org/DevTools/Hacking and all setup. Please guide me through other steps. :)
Comment 16•10 years ago
|
||
Hi agarwal7781, I'm happy to work with you on this bug.
At the moment, I've added menu titles and functions responsible of turning on/off Highlighting mode. Here are the files I've modified : devtools/client/locales/en-us/scratchpad.dtd, devtools/client/scratchpad/scratchpad.xul, devtools/client/scratchpad/scratchpad.js .
I also assume the module responsible of pretty-printing is _prettyPrintWorker. We might have to delete it before switching to plain-text, and re-enable it to switch to JavaScript mode.
I think we should take a look at https://wiki.mozilla.org/DevTools#Remote_Debugging_Protocol, to be able to observe modifications we'll add.
Keep me up to date.
Comment 17•10 years ago
|
||
Hi Seb-dev, nice to hear from you, i will be following up the links provided by you and will update you ahead.
It's exciting to work on this with you, well this is my first bug so i might be asking more :).
Hope we have good time together.
And Apologies for replying late.. :)
Comment 18•10 years ago
|
||
Another good start is to get used to IRC, using devtools channel :
https://client00.chat.mibbit.com/?url=irc%3A%2F%2Firc.mozilla.org
I've talked with people on IRC and they told me they use the brower toolbox for debugging :
https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox
It already manages to work using remote debugging api.
So I started to test parts of the code on the plain-text function, and it appears that this.editor.setMode is releasing an Exception, but I can't figure out why.
So I commented the function call and the code kept running. I had to remove it to stop the function being called, so i'm wondering if I don't have any problem with my Firefox version.
I'll do my best to help you start inside the community. =)
Comment 19•10 years ago
|
||
Actually i have cloned the mozilla-central repository on my laptop and on building the same after every setup was done it is behaving unexpectely. I can't figure out what exactly the problem is.
Please share how can i reach u on IRC ? :)
Comment 20•10 years ago
|
||
You can reach me from devtools room when using this address :
https://client00.chat.mibbit.com/?url=irc%3A%2F%2Firc.mozilla.org
My pseudo is fireseb. The thing is i might not always be on.
Another point is that devtools team recommends to use a different repository :
https://wiki.mozilla.org/DevTools/Hacking#First_Build
So you might want to run :
hg clone http://hg.mozilla.org/integration/fx-team
And then, I got to say I've been through a lot of problems before being able to develop, so it's not that easy =).
Comment 21•10 years ago
|
||
HI Seb-dev, as said by you i have cloned the repositories and now what next step do i need to take. :)
Comment 22•10 years ago
|
||
Now you have to check out you've all the required dependencies :
https://developer.mozilla.org/en-US/docs/Simple_Firefox_build#Build_prerequisites
Depending on your OS, the steps might not be the same.
Then, you'll have to build firefox :
https://developer.mozilla.org/en-US/docs/Simple_Firefox_build#Building
It might take some time depending on your machine. For me, using a VM with ~2GB of RAM and 1 core clocked at 2.30 Ghz, it took me 1h.
Finally, you'll be able to work on the project :).
Comment 23•10 years ago
|
||
Ok i am doing it in case any problem i will reach u. :)
Comment 24•10 years ago
|
||
Hi seb-dev, do i have to install the directX too as i have windows 8.1 or this will be required to build the firefox. :)
Comment 25•10 years ago
|
||
I don't think you have to install directX. You should only install visual studio community and the Mozilla build package. DirectX sdk has to be installed to solve problems.
Hope you won't meet them.
Comment 26•10 years ago
|
||
Ok I have installed the visual studio, and i have also installed Mozilla Build Package and the directory is also cloned successfully.
What do we have to do in build configuration ?
Comment 27•10 years ago
|
||
You should now start a mozilla command prompt located in c:\mozilla-build by default\start-shell-msvc2013.bat as described in section "Opening a MozillaBuild command prompt" from https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites
and then run instructions from this link :
https://developer.mozilla.org/en-US/docs/Simple_Firefox_build#Building
Running mach build might take some time but then, you'll be able to start to develop.
Comment 28•10 years ago
|
||
Hi seb-dev, building is done i have run two commands --
./mach mercurial-setup
./mach build
its complete and now i think i am ready to develop... Now what to do next. :)
Comment 29•10 years ago
|
||
I now know as much as you do about Firefox developing. The Scratchpad files are located inside the firefox build directory at : devtools/client/scratchpad.
Have a look at the files I've sent to you above, they contains modifications I've done to add the Highlight menu bar. Now we have to find a way to add this functionnality :).
Comment 31•10 years ago
|
||
Here the work I've done to bring a plaintext option to the scratchpad.
As I wont be available to work on it anymore, I hope you will make use of it.
Regards
Attachment #8758004 -
Flags: review?(nfitzgerald)
Comment 32•10 years ago
|
||
Comment on attachment 8758004 [details] [diff] [review]
Add a plaintext highlighting option to firefox scratchpad.
Review of attachment 8758004 [details] [diff] [review]:
-----------------------------------------------------------------
The changes look good to me, but this needs test coverage in order to land in mozilla-central.
Attachment #8758004 -
Flags: review?(nfitzgerald)
Comment 34•9 years ago
|
||
Comment 35•9 years ago
|
||
Updated•8 years ago
|
Keywords: good-first-bug
Updated•8 years ago
|
Severity: normal → enhancement
Updated•8 years ago
|
Product: Firefox → DevTools
Comment 37•6 years ago
|
||
Scratchpad was removed in Bug 1519103 (Firefox 72). You can check the alternative in https://wiki.developer.mozilla.org/en-US/docs/Tools/Deprecated_tools#Scratchpad .
The Scratchpad bug list was reviewed and I think this bug can be safely closed.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Product: DevTools → DevTools Graveyard
Updated•6 years ago
|
Flags: needinfo?(nhnt11)
You need to log in
before you can comment on or make changes to this bug.
Description
•