From 38ed00c5ada01d2a4bb0e93b58c4ba8dcf06cf22 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 27 Dec 2016 03:21:38 +0100 Subject: [PATCH] doc --- docs/features_runnables.md | 13 ++--- docs/features_symbolic_strings.md | 52 +++++++++++++++++++- docs/widgets_custom_tools.md | 1 + docs/widgets_gdbcommander.md | 1 + docs/widgets_native_project_configuration.md | 1 + src/ce_symstring.pas | 2 +- 6 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 docs/widgets_custom_tools.md create mode 100644 docs/widgets_gdbcommander.md create mode 100644 docs/widgets_native_project_configuration.md diff --git a/docs/features_runnables.md b/docs/features_runnables.md index b3eabffd..305003d2 100644 --- a/docs/features_runnables.md +++ b/docs/features_runnables.md @@ -9,23 +9,24 @@ Runnable modules don't have to be explicitly saved because Coedit will handle th For example it's possible to execute the _Compile and run file_ action directly after the _New runnable module_ action . By default the binary is produced in the folder where is located the D source but this can be changed in the options applied to this feature. -A runnable is useful to quickly test an idea or to use a module as a script without messing with all the parameters that a project would require. +A runnable is useful to quickly test an idea, learn how to use new libraries, or even to use modules as scripts, always without messing with the parameters that a project would require. #### Shebang line By default runnables don't need any setting however the shebang line can be used when specific compiler options are required. Two typical scenario: -- the runnable will be debugged so symbolic debugging information must be generated with `-g`. -- the runnable must be linked with a C static library so linker flags `-L-lthelib` must be specified. +- the runnable will be debugged so DWARF information must be generated with `-g`. +- the runnable must be linked with a C static library so the linker flag `-L-lthelib` must be specified. -Coedit doesn't handle the program specified after the She-Bang, which means that any of the following script line are valid: +Coedit doesn't handle the program specified after the She-Bang, which means that any of the following script lines are valid: - `#!runnable-flags: --whatever` - `#!usr/bin/dmd --whatever` - `#!options --whatever` In the three cases, every non white character after the She-Bang is ignored. +Options are detected after the first non white character of the script line. #### Runnable I/O handling @@ -67,8 +68,8 @@ Note that the action _Run file unittest_ is based on the same internal function ![](img/options_runnables.png) - __alwaysToFolder__: When checked the folder specified in __outputFolder__ is handled, even if the runnable module is not part of the current project. -- __compiler__: Select the [compiler](options_compilers_paths) used to produce the runnable binary. +- __compiler__: Select the [compiler](options_compilers_paths) used to produce the runnable binary. When GDC or LDC is selected their bridges based on DMD command line interface are used (GDMD and LDMD). - __detectLibraries__: When checked the static libraries used by the runnable are detected from the [library manager](widgets_library_manager) by performing import analysis. When unchecked, all the library manager entries are passed and the compiler does the selection. - __detectMain__: When checked the `main()` function is detected automatically and the `-main` switch is set accordingly. When not checked `-main` is never passed. This options is useful with the **Run file unittests** action because it allows to test a module that's also a valid program. -- __outputFolder__: Defines a folder where the runnable binary is output. If the runnable is part of the project this folder is used otherwise __alwaysToFolder__ must also be checked. When the folder is a relative path, it is solbed using the runnable module parent directory as root. +- __outputFolder__: Defines a folder where the runnable binary is output. If the runnable is part of the project this folder is used otherwise __alwaysToFolder__ must also be checked. When the folder is a relative path, it is solved using the runnable module parent directory as root. - __staticSwitches__: Defines a list of switches that are always passed to the compiler when a runnable is produced or when a module is tested. diff --git a/docs/features_symbolic_strings.md b/docs/features_symbolic_strings.md index 8d1c8b69..1b50d1a5 100644 --- a/docs/features_symbolic_strings.md +++ b/docs/features_symbolic_strings.md @@ -1 +1,51 @@ - +### Symbolic strings + +The symbolic strings represent variables defined by the software. They are used by several widgets: + +- the [runnable modules shebang line](features_runnables). +- the [native project confirguration widget](widgets_native_project_configuration): many fields accept symbols. +- the [custom tools](widgets_custom_tools): parameters, working directory. +- the [process input](widgets_process_input): the input field can include a symbol. +- the [GDB commander](widgets_gdbcommander) custom commands. + +Possible symbols, by context, include: + +Application: + +- **``**: also _``_. Expanded to Coedit filename. +- **``**: also _``_. Expanded to Coedit path. + +Environment: + +- **``**: Expanded to the user home directory. This is the equivalent of `HOME` (on a Posix system) or `USERHOME` (on a Windows system). +- **``**: Expanded to the user temporary directory. +- **``**: Expanded to the user name. + +Current file: + +- **``**: also _``_. Expanded to the current file filename. +- **``**: also _``_. Expanded to the current file path. +- **``**: also _``_. Expanded to the identifier located at the caret position. +- **``**: also _``_. Expanded to the current line of code. +- **``**: also _``_. Expanded to the current selection. + +Current project: + +- **``**: also _``_. Expanded to the project filename. +- **``**: also _``_. Expanded to a list that contains each D source of the project. Each item is separated by a line ending. +- **``**: also _``_. Expanded to the project name (it's filename minus its path and extension) +- **``**: also _``_. Expanded to the project output filename (a static library filename, a program name, etc.) +- **``**: also _``_. Expanded to the project output parent directory. +- **``**: also _``_. Expanded to the project path. +- **``**: also _``_. Expanded to the field _RootFolder_ of a CE project (n/a if the current project is for DUB). +- **``**: also _``_. Expanded to the sources common directory. + +The expanded form of a symbol is never empty. When a symbol expands to nothing it's set to a pair of back quotes, e.g **\``** for a **``** when no project is opened. + +The slices located before and after the symbols are passed in their original form, e.g: + +`http://www.google.com/search?q="dlang.org"&btnI=Im+Feeling+Lucky` + +is expanded to: + +`http://www.google.com/search?q="dlang.org"indexOf&btnI=Im+Feeling+Lucky` if **indexOf** is the current identifier. diff --git a/docs/widgets_custom_tools.md b/docs/widgets_custom_tools.md new file mode 100644 index 00000000..8d1c8b69 --- /dev/null +++ b/docs/widgets_custom_tools.md @@ -0,0 +1 @@ + diff --git a/docs/widgets_gdbcommander.md b/docs/widgets_gdbcommander.md new file mode 100644 index 00000000..8d1c8b69 --- /dev/null +++ b/docs/widgets_gdbcommander.md @@ -0,0 +1 @@ + diff --git a/docs/widgets_native_project_configuration.md b/docs/widgets_native_project_configuration.md new file mode 100644 index 00000000..8d1c8b69 --- /dev/null +++ b/docs/widgets_native_project_configuration.md @@ -0,0 +1 @@ + diff --git a/src/ce_symstring.pas b/src/ce_symstring.pas index aba570b3..753dd7ad 100644 --- a/src/ce_symstring.pas +++ b/src/ce_symstring.pas @@ -285,7 +285,7 @@ begin 'CFF', 'CurrentFileFile' : Result += fSymbols[CFF]; 'CFP', 'CurrentFilePath' : Result += fSymbols[CFP]; 'CI', 'CurrentIdentifier' : Result += fSymbols[CI]; - 'CL', 'CUrrentLine' : Result += fSymbols[CL]; + 'CL', 'CurrentLine' : Result += fSymbols[CL]; 'CS', 'CurrentSelection' : Result += fSymbols[CS]; // 'CPF', 'CurrentProjectFile' : Result += fSymbols[CPF];