pyjarrett / septum Goto Github PK
View Code? Open in Web Editor NEWContext-based code search tool
License: Apache License 2.0
Context-based code search tool
License: Apache License 2.0
Some searches dump a lot of output for a long time. Ctrl-C should be used to stop the search or the printing of search results.
Alternatives
Linux output is ridiculously slow!?
This is a definite regression since I know this wasn't a problem a while ago.
The usage of load-time command scripts via .septum/.config
fileswithin the user's home directory and current working directory is not documented and should be included in program help.
Is your feature request related to a problem? Please describe.
I can exit the program only by typing 'quit'. I would like to be able to exit using a keyboard shortcut.
Describe the solution you'd like
When the user presses Ctrl-D, the program exits. Programs like python
do this when the user is in the prompt.
I'm finding that sometimes the best way to filter large numbers of results is to remove large portions of the search tree.
It'd be easier to be able to add keep/exclude filters like used for contexts, but which would apply to file names. This might also replace the need to only search specific extensions.
I often find myself needing search results later and I find myself copying and pasting searches to save them for later.
A command should exist to save the a search and its results to disk. This might be to separate files, one with commands which could be sourced at a later time to restore the search (such as to have its results compared), but this need is further down the road. Any file written with search results should be timestamped.
Possibles solution, not sure if export
or save
is the right command name here:
save <file_name>
save "Importing_C_Functions"
results in Importing_C_Functions.septum
and Import_C_Functions.YYYYMMDD.HHMM.txt
in the closest .septum/
directory.
This is to isolate program printing to a specific module to allow writing output directly to file at a later time, and for later controlling verbosity and severity of messages.
GNATCOLL.Terminal
provide colorized output for lines which include a match.enable-line-colors
and disable-line-colors
commands to toggle the setting on/off respectivelySP.Terminal
, causing color commands to be ignored if coloration is turned off.It's possible for a source
d file to create a cycle, resulting in infinite sourcing.
There needs to be an intermediate option between case-sensitive search, and using regular expressions for describing search text. Regular expression usage for case-insensitive is very verbose, since the regexp parser doesn't currently allow for special flags.
find-like
and exclude-like
to apply case-insensitive filters.find-text
and exclude-text
such as --case-insensitive
. This would require option parsing for commands.Is your feature request related to a problem? Please describe.
With many, many results it'd be nice to be able to sort the field of results without throwing out the candidates entirely.
Describe the solution you'd like
A prefer
command to match for specific terms to cause contexts containing them to rank higher in search results.
The automation for creating chocolatey builds would benefit from the program itself being able to describe its version. This would prevent packaging mistakes.
It's useful to see how many total files matched in addition to the raw number of contexts found.
This is a stepping stone to being able to load and save search state.
This should operate similarly to .septum/.config
files where commands are run, line-by-line as if they were typed:
For example, source my_commands_to_run
might result in:
> clear-dirs
> clear-filters
> add-dirs C:/dev/my_project/
> add-dirs C:/dev/other_library/
> only-exts c h
Appropriate error messaging should be provided for when a command file cannot be run.
Unable to run commands from my_commands_to_run - file does not exist.
Integration tests would help verify behavior and provide examples of what Septum can do.
This should all be done without any external programs to simplify portability to multiple platforms.
Possible implementation:
septum-integration-tests.gpr
file which uses GNAT.OS_Lib
and/or GNAT.Expect
for building and running septum. See AdaCore gem 54 for examplesIs this a bug or a feature?
Is your feature request related to a problem? Please describe.
It seems possible to only search in files that have a specific extension, but it's not possible to (exclude) search in files that start/contain a specific string or are in some specific folder.
Describe the solution you'd like
a-*.ads
or exclude *_test.cu
(like #13)./**/test/
or ./**/examples/**/
(**
here means a hierarchy of one or more folders)Septum currently checks a very limited selection of extensions to determine if a file is text or not, in order to speed up loading of large source trees and minimize junk files loaded into memory to minimize its memory footprint.
Is your feature request related to a problem? Please describe.
Configuration files don't support blank lines or any sort of comment.
Describe the solution you'd like
Allow blank lines and use #
as the first non-whitespace character as a comment.
I have reviewed your work and have some suggestions for improvement. I would say that String
can replace Unbounded_String
in just about all cases.
Ada.Containers.Indefinite_Vectors/Ordered_Maps/Holders
instantiated with String
instead of Unbounded_String
vectors and maps.Index_Type
like Line_Number
etc instead of Positive
.subtype String_Vector is String_Vectors.Vector
etc just after container instantiation. This will make the code shorter and lighter.String
parameters instead of Unbounded_String
.Directory_Name
/ File_Name
/ Program_Line
from String
.subtype String_Vector is SP.Strings.String_Vectors.Vector
in packages using a lot of String_Vectors.Vector
.I hope the suggestions can be used. Exited to get a macOS version soon..;-)
Describe the bug
The output printed by help
is printed quite slowly.
To Reproduce
Steps to reproduce the behavior:
Expected behavior (if applicable)
See the help text getting printed more or less instantly
Desktop (please complete the following information):
Additional context
Minor issue.
When iterating with filters, it's irritating to keep having to do match-contexts
or match-filters
every time filters are changed.
Provide some configuration option to automatically do match-contexts
or match-filters
whenever filters are added. It's not entirely clear if it's also useful behavior when filters are removed as well.
Are your filters set up correctly?
This is especially a problem with regular expressions. Yes, you wrote it, but will it capture what you want?
Add a test
command which reports if the text following test
will be caught by the current filter set or not. This could also be test
mode in which multiple lines of text can be entered with FOUND or IGNORED reported for each test line.
Make it clear to users that they're operating off of a snapshot of the last file load.
Include text within the prompt to indicate the time since the last snapshot and/or the time of the last snapshot.
Possible solutions:
Last Snapshot: 15 minutes ago
or
Last Snapshot: 6/2/2021, 9:21 pm
Prevent spam in systems without clearing capabilities by disabling the progress spinner if a tty is not attached.
Is your feature request related to a problem? Please describe.
With many results, it's hard to sort through sometimes. Being able to paginate results would help.
Describe the solution you'd like
Possible start/end values to match-contexts
The terminal environment isn't being restored on program close.
Trendy_Terminal.Shutdown
should be called on exit. Due to some internals, this requires a second look at a clean way to properly do this, I'm thinking an RAII type in the main event loop.
Is your feature request related to a problem? Please describe.
septum init
creates a file .septum/config
in the current working directory, but I would like to create it relative to the home directory.
Describe the solution you'd like
When Septum tries to create .septum/config
in the home directory, it should instead store it relative to $XDG_CONFIG_HOME. If this environment variable is not defined, it should have the value $HOME/.config
. Thus the full path becomes $HOME/.config/septum/config
.
Similarly, cache files (don't know if Septum has any) could be relative to $XDG_CACHE_HOME (which is by default $HOME/.cache
).
Due to a bad post-condition:
function Closest_Config (Dir_Name : String) return Virtual_File with
Pre => Ada.Directories.Exists (Dir_Name),
Post => Is_Regular_File (Closest_Config'Result) -- <<<<<<<<<<<<<<
is
which is bad because the result might be No_File
.
As an enhancement for interactive mode, using GNATCOLL.Readline would be great.
Describe the bug
When typing the TAB key in interactive search, the program crashes
To Reproduce
Expected behavior (if applicable)
No crash
Desktop (please complete the following information):
Additional context
fred@localhost $ septum
septum v0.0.2
Files: 0 Extensions: Any
Distance: 7 Max Results: Unlimited
> raised CONSTRAINT_ERROR : SP.Strings.String_Vectors.Constant_Reference: Index is out of range
[bin/septum]
0x42614c Sp.Strings.String_Vectors.Constant_Reference at a-convec.adb:326
0x493ef2 Sp.Interactive.Complete_Input at sp-interactive.adb:255
0x49bf58 trendy_terminal__io__get_line at ???
0x490e34 Sp.Interactive.Read_Command at sp-interactive.adb:291
0x495354 Sp.Interactive.Main at sp-interactive.adb:351
0x40f7c1 Septum at septum.adb:45
0x410309 Main at b__septum.adb:538
[/lib/x86_64-linux-gnu/libc.so.6]
0x7fde0e96d0b1
[bin/septum]
0x40f5fc _start at ???
0xfffffffffffffffe
Exception traceback: [bin/septum]
0x42614c Sp.Strings.String_Vectors.Constant_Reference at a-convec.adb:326
0x493ef2 Sp.Interactive.Complete_Input at sp-interactive.adb:255
0x49bf58 trendy_terminal__io__get_line at ???
0x490e34 Sp.Interactive.Read_Command at sp-interactive.adb:291
0x495354 Sp.Interactive.Main at sp-interactive.adb:351
0x40f7c1 Septum at septum.adb:45
0x410309 Main at b__septum.adb:538
[/lib/x86_64-linux-gnu/libc.so.6]
0x7fde0e96d0b1
[bin/septum]
0x40f5fc _start at ???
0xfffffffffffffffe
Program crashes if input is made while directories are being loaded, or when a search is occurring.
To Reproduce
Steps to reproduce the behavior:
septum
<MASH BUTTONS WHILE DIRECTORIES LOAD>
raised CONSTRAINT_ERROR : bad input for 'Value: "dfasdfasdf
D:\dev\ada\septum\bin\septum.exe]
0x7ff68ece8bf2 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ece72d8 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ece7334 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ebed47c at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ebed83a at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ebcb6c6 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68eb716d9 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ed0a7a9 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68eb71422 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68eb7113b at ???
[C:\Windows\System32\KERNEL32.DLL]
0x7ff96dba7032
[C:\Windows\SYSTEM32\ntdll.dll]
0x7ff96e40264f
Exception traceback: [D:\dev\ada\septum\bin\septum.exe]
0x7ff68ece8bf2 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ece72d8 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ece7334 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ebed47c at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ebed83a at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ebcb6c6 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68eb716d9 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68ed0a7a9 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68eb71422 at ???
[D:\dev\ada\septum\bin\septum.exe]
0x7ff68eb7113b at ???
[C:\Windows\System32\KERNEL32.DLL]
0x7ff96dba7032
[C:\Windows\SYSTEM32\ntdll.dll]
0x7ff96e40264f
Desktop (please complete the following information):
Sometimes add-dirs takes a LONG time when there's lots of directions.
There should be a progress indication that (1) the program is still working (2) that amount of work left to do.
Describe the bug
Build has been broken for a while:
xmlada doesn't build out of msys64 Github Actions. It works fine for me locally.
septum uses an unreleased version of Trendy_Terminal
Deploy a new version of Trendy_Terminal (0.0.2)
Follow-up on xmlada build discussion
Describe the bug
A Constraint_Error is raised after pressing the tab key
To Reproduce
Steps to reproduce the behavior:
Expected behavior (if applicable)
An error message or a list of files?
Desktop (please complete the following information):
alr get septum
)Additional context
Add any other context about the problem here. If you got a stack trace, post that here.
The stacktrace didn't display line numbers (even though the executable has debug_info), but in gdb I get this:
#0 0x0000555556257ec6 in ?? ()
#1 0x0000555555597963 in sp.strings.string_vectors.constant_reference (container=...,
index=index@entry=2) at /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/adainclude/a-convec.adb:326
#2 0x000055555561ca6d in sp.interactive.complete_input (l=...)
at /home/onox/septum_0.0.4_b77a91de/src/common/sp-interactive.adb:167
#3 0x000055555561eafe in trendy_terminal.io.line_editors.complete ()
#4 0x000055555561ffaf in trendy_terminal.io.line_editors.get_line ()
#5 0x000055555562088f in trendy_terminal.io.line_editors.get_line ()
#6 0x0000555555618e28 in sp.interactive.read_command (line_history=...)
at /home/onox/septum_0.0.4_b77a91de/src/common/sp-interactive.adb:188
#7 0x000055555561d99f in sp.interactive.main ()
at /home/onox/septum_0.0.4_b77a91de/src/common/sp-interactive.adb:242
#8 0x000055555557ef81 in septum () at /home/onox/septum_0.0.4_b77a91de/src/common/septum.adb:55
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.