Editing User:Shainasabarwal/ScadLexer for ScintillaEditor
From BRL-CAD
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
==Background Information== | ==Background Information== | ||
− | *Computer Science Engineering student at Guru Nanak Dev Engineering College, | + | *Computer Science Engineering student at Guru Nanak Dev Engineering College, Ludhina, Punjab, India. Presently studying in 4th year. |
− | *I have worked in C++, Qt, Wt, HTML, CSS, Javascript, Ruby on rails, flex and Bison and Wordpress. | + | *I have worked in are C++, Qt, Wt, HTML, CSS, Javascript, Ruby on rails, flex and Bison and Wordpress. |
*Have worked with OpenSCAD in 2014 on project UI Brushup of OpenSCAD that was about enhancing the interface for users of OpenSCAD by adding QScintilla Editor and its various features, Toolbars with small 2D icons. Options to choose color scheme of the solid models, and launching screen of OpenSCAD. | *Have worked with OpenSCAD in 2014 on project UI Brushup of OpenSCAD that was about enhancing the interface for users of OpenSCAD by adding QScintilla Editor and its various features, Toolbars with small 2D icons. Options to choose color scheme of the solid models, and launching screen of OpenSCAD. | ||
+ | *Also interested in front end development. Recently developed a wordpress theme for language learning institure - Global Careers. Some screenshots are: | ||
*I am active member of Linux User Group, Ludhiana where the students are made aware about the open source technologies and motivated to contribute in them. | *I am active member of Linux User Group, Ludhiana where the students are made aware about the open source technologies and motivated to contribute in them. | ||
Line 16: | Line 17: | ||
===Title: SCAD lexer for QScintilla Editor=== | ===Title: SCAD lexer for QScintilla Editor=== | ||
− | This project aims to make lexer specifically for SCAD language. Currently, QScintilla is using CPP lexer, which cause syntax problem as CPP language is very large as compared to SCAD language of OpenSCAD. With this, some scintilla | + | This project aims to make lexer specifically for SCAD language. Currently, QScintilla is using CPP lexer, which cause syntax problem as CPP language is very large as compared to SCAD language of OpenSCAD. With this, some scintilla related issues will also be solved. |
'''QsciLexerCustom inherited lexer''' | '''QsciLexerCustom inherited lexer''' | ||
− | + | QScintilla library has a class QsciLexerCustom which can be used as a base for new language lexers. The advantage of using this class is that it doesn't require to make any change in QScintilla code or to re-compile it. | |
− | QScintilla library has a class QsciLexerCustom | + | This will be inherited and its virtual functions will be redefined to make lexer for SCAD language. |
− | This will be inherited | ||
'''Defining style index for SCAD language''' | '''Defining style index for SCAD language''' | ||
SCAD language includes various categories of keywords including mathematical functions, solid primitives as defined: http://www.openscad.org/cheatsheet/ ,Operators, Numbers, Comments - single line as well as multiline, single quoted and double quoted strings, parenthesis and variable names. | SCAD language includes various categories of keywords including mathematical functions, solid primitives as defined: http://www.openscad.org/cheatsheet/ ,Operators, Numbers, Comments - single line as well as multiline, single quoted and double quoted strings, parenthesis and variable names. | ||
− | The lexer | + | The lexer firtly requires to index the styles for the purpose of syntax highlighting using functions of qsciLexerCustom. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
'''Syntax Highlighting''' | '''Syntax Highlighting''' | ||
− | + | Different functions for highlighting of keywords, operators, numbers, mathematical functions etc will be defined in the lexer which will be using their respective style (as defined in the index) for coloring and setting fonts. | |
− | + | A demo for keyword highlighting is: https://gist.github.com/shaina7837/a172752b717e7fe7ec14 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
'''Different Color scheme''' | '''Different Color scheme''' | ||
− | + | A number of different color schemes for users to be selected in preferences will be defined. In code, it will require checking the selected scheme and define style index accordingly. | |
− | |||
'''Issue #1108 Customizable Icon set''' | '''Issue #1108 Customizable Icon set''' | ||
Line 71: | Line 38: | ||
'''Issue #1056 Toolbar Buttons''' | '''Issue #1056 Toolbar Buttons''' | ||
− | Toolbars requires more icons as demanded | + | Toolbars requires more icons as demanded in this. |
'''Issue #1172 Syntax highlighting: # affects the whole line''' | '''Issue #1172 Syntax highlighting: # affects the whole line''' | ||
As presently, qscintilla uses CPP lexer, so it takes the whole line as preprocessor directive, started with #. With writing lexer specifically for SCAD language, this problem will be tackled. | As presently, qscintilla uses CPP lexer, so it takes the whole line as preprocessor directive, started with #. With writing lexer specifically for SCAD language, this problem will be tackled. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
'''Issue #1075 Add multi-line, nested list '[' ']' indentation and tree folding to QScintilla Editor''' | '''Issue #1075 Add multi-line, nested list '[' ']' indentation and tree folding to QScintilla Editor''' | ||
Line 86: | Line 48: | ||
'''Issue #915 Scintilla Editor issues''' | '''Issue #915 Scintilla Editor issues''' | ||
The remaining issues such as auto scroll to error line after compilation, convert tab into spaces and highlighting the folded region will be solved. | The remaining issues such as auto scroll to error line after compilation, convert tab into spaces and highlighting the folded region will be solved. | ||
+ | |||
+ | |||
==MILESTONES== | ==MILESTONES== | ||
Line 123: | Line 87: | ||
'''Week 8(13 july)''' | '''Week 8(13 july)''' | ||
*Solve scintilla related issues listed in issue #915 | *Solve scintilla related issues listed in issue #915 | ||
− | + | ||
'''Week 9, 10(20 july)''' | '''Week 9, 10(20 july)''' | ||
*Find a way to fetch icons from a icons file rather than directly coded in mainwin.cc | *Find a way to fetch icons from a icons file rather than directly coded in mainwin.cc | ||
Line 159: | Line 123: | ||
===Code Review=== | ===Code Review=== | ||
− | I already has commit access to openscad respository at https://github.com/openscad/openscad. I will push my code in separate branch of same repository and send pull request so that mentors | + | I already has commit access to openscad respository at https://github.com/openscad/openscad. I will push my code in separate branch of same repository and send pull request so that mentors and review my code and then merge it up in master branch after complete testing. |
==Why OpenSCAD?== | ==Why OpenSCAD?== | ||
Line 165: | Line 129: | ||
==Why SCAD lexer project?== | ==Why SCAD lexer project?== | ||
− | I came up with this idea of adding scad lexer as gsoc project, because last time, I | + | I came up with this idea of adding scad lexer as gsoc project, because last time, I in my project 'UI brushup of OpenSCAD' and used QsciLexerCPP as a base class for SCAD language. But as the CPP is very large language as compared to SCAD so it is causing various issue, which I came to know later. In this year, I want to solve all those issues by adding a lexer specifically for scad lexer. |
==Why Me?== | ==Why Me?== | ||
As we have very less number of women in technical study as compared to men, I want to be the part of technical community and spread awareness about women in tech in our society. I learnt a lot being the part of this community and want to contribute more through this program and afterwards. I also shared idea of improving the website of OpenSCAD but that couldn't be the part of this project, so I have plans to do so after completion of this project. | As we have very less number of women in technical study as compared to men, I want to be the part of technical community and spread awareness about women in tech in our society. I learnt a lot being the part of this community and want to contribute more through this program and afterwards. I also shared idea of improving the website of OpenSCAD but that couldn't be the part of this project, so I have plans to do so after completion of this project. |