Comments (21)
How do you want it formatted? In Html with classes or styles?
I'll have a go at this if there isn't a solution already there.
Original comment by [email protected]
on 15 Oct 2008 at 12:54
from firephp.
A possible route to a solution:
http://jscc.jmksf.com (LALR(1)) javascript parser generator
http://savage.net.au/SQL/ BNF grammers for sql
The grammar instructions could either return html code or build a dom document
fragment...
Original comment by [email protected]
on 15 Oct 2008 at 1:04
from firephp.
this approach would be slow and large, but correct (if it al works)
Original comment by [email protected]
on 15 Oct 2008 at 1:10
from firephp.
I like the idea of implementing this properly rather than as a quick fix but as
you
mentioned it could become quite the undertaking.
The result should ideally integrate with domplate but that may be very
complicated to
accomplish right off the bat. The best approach may be to generate a tree
containing
the different elements and hints to indicate the type of each element.
We can then write a renderer that uses the tree to generate a HTML
representation
directly or one that integrates with domplate.
Before you start on this it may be worth while to do a bit more research to
ensure
there is not something already out there or more suitable as a base. Maybe we
could
use a code editor/colorer as the base instead
(http://marijn.haverbeke.nl/codemirror/)? I am looking for a PHP code
viewer/editor
as well and I have been looking at codemirror to accomplish this.
Original comment by [email protected]
on 15 Oct 2008 at 8:06
from firephp.
I agree, we'll need to investigate whether codemirror can be "stripped" down
easiliy.
Disadvantage of Codemirror is that it's parsers are hand written. It is however
a
very active project and I think Marijn will be able to help out (I'm also
Dutch).
I'll ask him to respond to this issue.
Original comment by [email protected]
on 15 Oct 2008 at 10:58
from firephp.
Yes. I like that the project seems active. Maybe you could ask him about his
future
plans and commitment to codemirror.
My plans are to make FirePHP and more importantly the overall concept of
debugging
AJAX and server apps this way a household name so I am looking to incorporate
code
that will stay maintained.
Original comment by [email protected]
on 15 Oct 2008 at 11:08
from firephp.
Addinitional features requested by co-workers (they are to lazy to reply
themselves):
SQL: folding of clauses
But you probably already had that in mind
Folding might also be useful for PHP code.
I'd say creating a SQL parser shouldn't be to difficult given the existing
SPARQL parser.
Original comment by [email protected]
on 15 Oct 2008 at 11:12
from firephp.
Hi. I'm the author of CodeMirror. If you just want something to *display*
highlighted
code, it's bound to be easier to just write something from scratch. A lot of
CodeMirror's complexity is related to the fact that it's an editor, and has to
do the
parsing incrementally while the text is being edited. As for commitment, I'm not
planning to stop fixing bugs anytime soon, but since this is all unpaid, I
can't make
any guarantees -- I don't always have a lot of time.
Original comment by [email protected]
on 16 Oct 2008 at 8:08
from firephp.
Displaying the highlighted SQL would be the first step but I see a few other
features
over time:
1) Have the renderer automatically format and indent an SQL query for easier
reading.
Would be great if the user could setup a "profile" on how to indent the query
and
have the renderer follow that profile for all subsequent queries.
2) Ability to render partial and invalid queries to allow easier debugging and
fixing
of queries
3) Ability to edit queries in FirePHP and save modifications back to server code
I am planning on making FirePHP two-way allowing you to edit your server code in
FirePHP and saving it back to the server. So the above requirements also apply
to
PHP, CSS, HTML, XML, JSON, etc... code. I would be looking for an editor that
can
accomplish highlighting and editing of all these languages.
Do you think CodeMirror could accomplish this?
Original comment by [email protected]
on 16 Oct 2008 at 7:04
from firephp.
@christoph:
Did you check out
http://codepress.sourceforge.net/
yet?
Codepress allready has PHP and SQL implemented according to
http://en.wikipedia.org/wiki/Comparison_of_Javascript-based_source_code_editors
No offence Marijn!
Original comment by [email protected]
on 16 Oct 2008 at 8:18
from firephp.
Yes I had some time ago, but there has been very little development activity
for a
while so I am not too sure about the state of the project.
Thanks for the link to the matrix!
What do you think of EditArea?
Original comment by [email protected]
on 16 Oct 2008 at 8:51
from firephp.
Anyone interested in starting a project to port GeSHi
(http://qbnz.com/highlighter/)
to JavaScript and adding an editor component?
Original comment by [email protected]
on 17 Oct 2008 at 12:48
from firephp.
[deleted comment]
from firephp.
[deleted comment]
from firephp.
[deleted comment]
from firephp.
Google code itself (you know, this site) uses a JavaScript called prettify.
http://code.google.com/p/google-code-prettify/
Includes SQL per the FAQ.
Original comment by sroussey
on 28 Apr 2009 at 12:20
from firephp.
I don't think this lib meets the necessary requirements. We need something that
breaks the SQL into its parts and colors each part appropriately with the
ability to
format it as well.
Original comment by [email protected]
on 28 Apr 2009 at 3:44
from firephp.
What about http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes:SQL instead
of GeSHi
Original comment by [email protected]
on 12 May 2009 at 9:42
from firephp.
Looks like a better fit. No formatting but that could be added later if really
necessary. I wonder how this lib works with complex SQL queries.
Original comment by [email protected]
on 13 May 2009 at 1:01
from firephp.
Here you can see a sample of the highlighter:
http://www.sawey.be/sql-highlight/
Original comment by [email protected]
on 14 May 2009 at 8:17
from firephp.
Looks like it can handle most of the syntax. Function highlighting does not
seem to
work in all cases.
Looking at the formatting and highlighting it should be possible to add
auto-formatting support if all the nested brackets are properly parsed as well.
Original comment by [email protected]
on 14 May 2009 at 8:49
from firephp.
Related Issues (20)
- FirePHP fails to interpret Responses if window.open is called during pageload HOT 6
- Extension not appending "FirePHP" to user-agent header in Firefox 10 on Mac OS X HOT 11
- Group dumps HOT 2
- Problem w/ FirePHP after update to FF13 HOT 5
- TypeError: firephp.app is undefined HOT 4
- Enhancement: a index.php test-page to the package
- FirePHP does not log primitives correctly (TRUE,FALSE,NULL, etc) HOT 1
- Right Click on link and clicking "Open Link in New Tab" doesn't work HOT 1
- array elements displayed in wrong order HOT 1
- Output fails to show correct log items when page redirects HOT 4
- [deleted issue]
- Update the source location HOT 1
- Variable Viewer for TABLE messages HOT 1
- Collapsed group isn't working with FireBug 1.13
- navigator.userAgent unmodified HOT 1
- Redirect to the same URL shows last log twice
- Missing icon when running with Firebug 2.0 HOT 8
- Table log HOT 3
- firephp icon lost
- FirePHP not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firephp.