[Github-comments] [geany/geany] Add Arduino custom filetype (#1339)

Colomban Wendling notifications at xxxxx
Thu Dec 15 08:23:35 UTC 2016


b4n requested changes on this pull request.

Apart from the comments, LGTM

> @@ -0,0 +1,56 @@
+# Arduino custom filetype
+#
+# By SukkoPera <software at sukkology.net>
+# 2016/12/14

timestamp is recorded in Git, no need to add it here IMO, esp. as it'll get forgotten and then out of date in no time :)

> +#
+# By SukkoPera <software at sukkology.net>
+# 2016/12/14
+#
+
+[styling=C]
+
+
+[keywords]
+primary=and and_eq asm auto bitand bitor bool boolean break byte case catch char class compl const const_cast constexpr continue decltype default delete do double dynamic_cast else enum explicit extern false final float for friend goto if inline int int8_t int16_t int32_t int64_t long mutable namespace new noexcept not not_eq nullptr operator or or_eq override private protected ptrdiff_t public register reinterpret_cast return short signed sizeof size_t static static_assert static_cast struct switch template this throw true try typedef typeid typename uint8_t uint16_t uint32_t uint64_t union unsigned using virtual void volatile while xor xor_eq
+secondary=abs analogRead analogReadResolution analogReference analogWrite analogWriteResolution attachInterrupt bit bitClear bitRead bitSet bitWrite constrain cos delay delayMicroseconds detachInterrupt digitalRead digitalWrite EEPROM Ethernet F highByte interrupts isAlpha isAlphaNumeric isAscii isControl isDigit isGraph isHexadecimalDigit isLowerCase isPrintable isPunct isSpace isUpperCase isWhitespace Keyboard LiquidCrystal loop lowByte map max micros millis min Mouse noInterrupts noTone pinMode pow PROGMEM pulseIn random randomSeed SD Serial Servo setup shiftIn shiftOut sin SoftwareSerial SPI sqrt Stepper tan tone Wire word yield
+
+
+[lexer_properties]
+styling.within.preprocessor=1
+lexer.cpp.track.preprocessor=0

IMO it should inherit C's properties: you use the same ones, and if it's plain C++ do as C++ does

> +
+[styling=C]
+
+
+[keywords]
+primary=and and_eq asm auto bitand bitor bool boolean break byte case catch char class compl const const_cast constexpr continue decltype default delete do double dynamic_cast else enum explicit extern false final float for friend goto if inline int int8_t int16_t int32_t int64_t long mutable namespace new noexcept not not_eq nullptr operator or or_eq override private protected ptrdiff_t public register reinterpret_cast return short signed sizeof size_t static static_assert static_cast struct switch template this throw true try typedef typeid typename uint8_t uint16_t uint32_t uint64_t union unsigned using virtual void volatile while xor xor_eq
+secondary=abs analogRead analogReadResolution analogReference analogWrite analogWriteResolution attachInterrupt bit bitClear bitRead bitSet bitWrite constrain cos delay delayMicroseconds detachInterrupt digitalRead digitalWrite EEPROM Ethernet F highByte interrupts isAlpha isAlphaNumeric isAscii isControl isDigit isGraph isHexadecimalDigit isLowerCase isPrintable isPunct isSpace isUpperCase isWhitespace Keyboard LiquidCrystal loop lowByte map max micros millis min Mouse noInterrupts noTone pinMode pow PROGMEM pulseIn random randomSeed SD Serial Servo setup shiftIn shiftOut sin SoftwareSerial SPI sqrt Stepper tan tone Wire word yield
+
+
+[lexer_properties]
+styling.within.preprocessor=1
+lexer.cpp.track.preprocessor=0
+preprocessor.symbol.$(file.patterns.cpp)=#
+preprocessor.start.$(file.patterns.cpp)=if ifdef ifndef
+preprocessor.middle.$(file.patterns.cpp)=else elif
+preprocessor.end.$(file.patterns.cpp)=endif

Those 4 should be removed, they never did anything in Geany and were removed in 09796ef727aa430588ee12fa6c83223acd1794a2

> +preprocessor.end.$(file.patterns.cpp)=endif
+
+
+[settings]
+lexer_filetype=C
+tag_parser=C
+extension=ino
+
+# context action command (please see Geany's main documentation for details)
+context_action_cmd=xdg-open "https://www.arduino.cc/en/Reference/%s"
+
+
+[indentation]
+width=2
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+type=0

`width` and `type` should always be commented out by default, unless it's a strict requirement of the language.  This is because it'll override the global user setting, so should be used with extreme caution.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1339#pullrequestreview-13078492
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20161215/2e5b4117/attachment.html>


More information about the Github-comments mailing list