Giter VIP home page Giter VIP logo

code-peek-atom's People

Contributors

dfreds avatar glammers avatar goronfreeman avatar jeff1995 avatar michael-garland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

code-peek-atom's Issues

Uncaught TypeError: Cannot read property 'ignoreCase' of undefined

steps to reproduce:

  1. remove the extension from a file
  2. peek at a function defined inside that file
  3. error

Atom Version: 1.13.1
Electron Version: 1.3.13
System: Microsoft Windows 10 Pro
Thrown From: code-peek package, v1.4.15

Stack Trace

Uncaught TypeError: Cannot read property 'ignoreCase' of undefined

At C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\default-directory-searcher.js:11

TypeError: Cannot read property 'ignoreCase' of undefined
    at new DirectorySearch (C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\default-directory-searcher.js:11:26)
    at DefaultDirectorySearcher.module.exports.DefaultDirectorySearcher.search (C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\default-directory-searcher.js:61:25)
    at C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\workspace.js:978:40
    at Map.forEach (native)
    at Workspace.module.exports.Workspace.scan (C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\workspace.js:957:30)
    at Object.scanWorkspace (file:///C:/Users/Jan Willem/.atom/packages/code-peek/lib/code-peek.coffee:115:20)
    at Object.peekFunction (file:///C:/Users/Jan Willem/.atom/packages/code-peek/lib/code-peek.coffee:110:6)
    at atom-text-editor.subscriptions.add.atom.commands.add.code-peek:peekFunction (file:///C:/Users/Jan Willem/.atom/packages/code-peek/lib/code-peek.coffee:57:37)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\command-registry.js:259:29)
    at CommandRegistry.handleCommandEvent (C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\command-registry.js:3:59)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\atom-environment.js:1181:28)
    at EventEmitter.outerCallback (C:\Users\Jan Willem\AppData\Local\atom\app-1.13.1\resources\app.asar\src\application-delegate.js:332:25)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -2:15.6.0 code-peek:peekFunction (span.syntax--text.syntax--plain.syntax--null-grammar)
     -1:43.4.0 find-and-replace:select-next (a.stack-toggle)
     -1:43 core:save (a.stack-toggle)
  2x -1:33.7.0 code-peek:peekFunction (span.syntax--text.syntax--plain.syntax--null-grammar)
     -0:33.8.0 tree-view:move (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:32.7.0 editor:move-to-end-of-screen-line (input.hidden-input)
     -0:31.8.0 core:confirm (input.hidden-input)
  2x -0:28.2.0 code-peek:peekFunction (span.syntax--entity.syntax--name.syntax--function.syntax--js)
     -0:17.2.0 bookmarks:jump-to-next-bookmark (input.hidden-input)
     -0:16.9.0 tree-view:move (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:15.7.0 core:move-right (input.hidden-input)
  2x -0:15.3.0 editor:select-to-end-of-word (input.hidden-input)
     -0:14.5.0 core:delete (input.hidden-input)
     -0:14.3.0 core:confirm (input.hidden-input)
  2x -0:10.7.0 code-peek:peekFunction (span.syntax--entity.syntax--name.syntax--function.syntax--js)
     -0:00.4.0 application:new-file (ul.list-inline.tab-bar.inset-panel)

Config

{
  "core": {
    "audioBeep": false,
    "disabledPackages": [
      "spell-check",
      "snippets"
    ],
    "followSymlinks": false,
    "packagesWithKeymapsDisabled": [
      "fonts"
    ],
    "projectHome": "C:\\Software\\",
    "telemetryConsent": "limited"
  }
}

Installed Packages

# User
atom-easy-jsdoc, v4.10.0 (active)
atom-html-preview, v0.1.22 (active)
code-peek, v1.4.15 (active)
emoji-syntax, v1.6.2 (active)
fonts, v2.0.0 (active)
jsdoc-generator, v0.2.3 (active)
markdown-scroll-sync, v2.1.2 (active)
minimap, v4.26.8 (active)
minimap-cursorline, v0.2.0 (active)
minimap-find-and-replace, v4.5.1 (active)
minimap-git-diff, v4.3.1 (active)
minimap-highlight-selected, v4.5.0 (active)
minimap-selection, v4.4.0 (active)
node-debugger, v1.10.0 (active)
single-click-open, v0.2.2 (active)
atom-dark-syntax, v0.28.0 (inactive)
atom-dark-ui, v0.53.0 (inactive)
atom-light-syntax, v0.29.0 (inactive)
atom-light-ui, v0.46.0 (inactive)
base16-tomorrow-dark-theme, v1.4.0 (inactive)
base16-tomorrow-light-theme, v1.4.0 (inactive)
one-dark-ui, v1.8.2 (active)
one-light-ui, v1.8.2 (inactive)
one-dark-syntax, v1.6.0 (active)
one-light-syntax, v1.6.0 (inactive)
solarized-dark-syntax, v1.1.1 (inactive)
solarized-light-syntax, v1.1.1 (inactive)
about, v1.7.2 (active)
archive-view, v0.62.0 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.14.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.33.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.29.0 (inactive)
autosave, v0.23.2 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.43.2 (active)
bracket-matcher, v0.85.1 (active)
command-palette, v0.39.1 (inactive)
deprecation-cop, v0.55.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (active)
find-and-replace, v0.204.5 (active)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.2.0 (active)
go-to-line, v0.31.2 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.60.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.1 (active)
link, v0.31.2 (inactive)
markdown-preview, v0.159.3 (active)
metrics, v1.1.3 (active)
notifications, v0.65.1 (active)
open-on-github, v1.2.1 (inactive)
package-generator, v1.0.2 (inactive)
settings-view, v0.244.0 (active)
snippets, v1.0.4 (inactive)
spell-check, v0.68.5 (inactive)
status-bar, v1.6.0 (active)
styleguide, v0.48.0 (active)
symbols-view, v0.113.1 (inactive)
tabs, v0.103.1 (active)
timecop, v0.33.2 (active)
tree-view, v0.211.1 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (active)
whitespace, v0.35.0 (active)
wrap-guide, v0.39.0 (active)
language-c, v0.54.0 (active)
language-clojure, v0.22.1 (active)
language-coffee-script, v0.48.1 (active)
language-csharp, v0.13.0 (active)
language-css, v0.40.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.43.0 (active)
language-html, v0.47.1 (active)
language-hyperlink, v0.16.1 (active)
language-java, v0.24.0 (active)
language-javascript, v0.122.0 (active)
language-json, v0.18.3 (active)
language-less, v0.29.6 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.37.0 (active)
language-php, v0.37.3 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.1 (active)
language-ruby, v0.70.2 (active)
language-ruby-on-rails, v0.25.1 (active)
language-sass, v0.57.0 (active)
language-shellscript, v0.23.0 (active)
language-source, v0.9.0 (active)
language-sql, v0.25.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.29.1 (active)
language-toml, v0.18.1 (active)
language-xml, v0.34.12 (active)
language-yaml, v0.27.1 (active)

# Dev
No dev packages

Excludes directories to search in

What do you think about adding an option to restrict some directories to search in, such as vendor for PHP or node_modules for JS?

Maybe it can help to search faster.

Thank you.

Support MagicPython

Currently, MagicPython syntax is not supported even when MagicPython is an alias of Python language.

Maybe we can improve the detection to support this.

Thanks

Uncaught Error: Can't save destroyed buffer

  1. Press cmd+alt+e on a function
  2. Go to matching files
  3. Open a file via the brackets icon in the code-peek panel
  4. Close this file via tab bar
  5. Click save in code-peek panel

Atom: 1.17.0-beta5 x64
Electron: 1.3.15
OS: Mac OS X 10.12.4
Thrown From: code-peek package 1.4.18

Stack Trace

Uncaught Error: Can't save destroyed buffer

At /Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1114

Error: Can't save destroyed buffer
    at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1114:1)
    at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1108:1)
    at TextEditor.module.exports.TextEditor.save (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:925:1)
    at CodePeekView.module.exports.CodePeekView.saveChanges (/packages/code-peek/lib/code-peek-view.coffee:187:27)
    at Object.toggleCodePeekOff (/packages/code-peek/lib/code-peek.coffee:226:19)
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:1)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:1)
    at /packages/code-peek/lib/code-peek-view.coffee:67:16)
    at HTMLSpanElement.dispatch (/packages/atom-beautify/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLSpanElement.elemData.handle (/packages/atom-beautify/node_modules/jquery/dist/jquery.js:4121:28)

Not compatible with Semanticolor

I'm trying to use code-peek 1.4.16 with Semanticolor, but there's a conflict. The problem is that to do its highlighting, Semanticolor prefixes the name of the current grammar with "semanticolor", so code-peek gives the error "Peek function does not currently support semanticolor - Ruby files".

So...perhaps it should ignore the "semanticolor" prefix or find some other way of determining the language?

Error reported

Peek function does not currently support Babel ES6 Javascript files. New to React and Atom so if there's a config file you want to see let me know.

Indexing Support

This plugin is awesome. However on a large project or when working on a busy drive or a or network folder, it can be extremely slow to find the function, even when it's in the same file as I'm working in. I've had cases of waiting 2-3 minutes at times. code-peek is basically useless in these cases.

I would like to suggest creating an index for each project and searching that rather than the entire codebase. It could be something as simple as a text file containing the name, path & line no of each function. We could then just update the relevant part of the index when each file is saved.

support Typescript class

TS uses classes as JS uses function as constructor.

Here is the propose regex:
class\s+REPLACE(\s+extends\s+[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*|)\s+{

This should cater for scenarios:

  1. class Replace {}
  2. class Replace extends Base {
  3. export class Replace {}
  4. export class Replace extends Base {}

Add support for golang .go files

I've been using this locally and it seems to work as expected. Assuming gofmt is used.

   'go':
      regExp: ///
        # Matches func REPLACE( or func (t target) REPLACE(
        func\s+(|\(.*\)\s+)REPLACE\(
      ///
      isTabBased: true

Matching:

  • func myMethod()
  • func (t Target) myMethod()
  • func myMethod(a args)
  • func (t Target) myMethod(a args)

Language type recognition suggestion.

Hello

It seems like the code-peek package recognize the language type base on the file extension. (correct me if i am wrong)

I think it would be more accurate to recognize from the current file syntax which was set in the right bottom of Atom.

qq 20170204184332

JSX Support

Should be quite similar to JavaScript support, it actually wouldn't surprise me if code-peek just has to ignore that the file is written in JSX instead of JavaScript.

Error update on Atom v1.9.9

Atom Version: 1.9.9
System: Mac OS X 10.11.6 (15G31)
Thrown From: code-peek package, v1.4.9

Stack Trace

screen shot 2016-08-21 at 5 48 28 pm

There is a update for package, but when I make to update the error above is show Atom console.

Option to open 'Code Peek' panel right below the focused line

Similar to the behavior in brackets, instead of expanding the panel away from the cursor, it would be nice if it could be done closer to the cursor itself. One of the things brackets does is that it only peeks the function (not the entire file) and therefore there is no scrolling within the peek panel. It simply expands some lines in the middle of the document.

please add css

Hi i'm andre is possible add css to the supprot fiels? where i can tweak the code to do that?

Uncaught SyntaxError: Invalid regular expression: /function\s **\s*\(|**\s*(=|:)\s*function\s*\(/...

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.8.0
System: Mac OS X 10.11.5
Thrown From: code-peek package, v1.4.8

Stack Trace

Uncaught SyntaxError: Invalid regular expression: /function\s \s(|*\s_(=|:)\s_function\s*(/: Nothing to repeat

At /Users/18740973/.atom/packages/code-peek/lib/supported-files.coffee:160

SyntaxError: Invalid regular expression: /function\s **\s*\(|**\s*(=|:)\s*function\s*\(/: Nothing to repeat
    at new RegExp (native)
    at Function.module.exports.SupportedFiles.getFunctionRegExpForFileType (/Users/18740973/.atom/packages/code-peek/lib/supported-files.coffee:160:16)
    at Object.module.exports.CodePeek.peekFunction (/Users/18740973/.atom/packages/code-peek/lib/code-peek.coffee:108:29)
    at atom-text-editor.subscriptions.add.atom.commands.add.code-peek:peekFunction (/Users/18740973/.atom/packages/code-peek/lib/code-peek.coffee:57:37)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1106:28)
    at EventEmitter.outerCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/application-delegate.js:340:25)
    at emitThree (events.js:97:13)
    at EventEmitter.emit (events.js:175:7)

Commands

     -1:11.1.0 core:save (atom-text-editor.editor.is-focused)
  3x -0:27.7.0 code-peek:peekFunction (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "linter-bootlint",
      "fonts",
      "symbols-view"
    ],
    "themes": [
      "one-dark-ui",
      "solarized-dark-syntax"
    ]
  }
}

Installed Packages

# User
aligner, v0.22.0
aligner-css, v1.2.0
aligner-scss, v1.1.0
angularjs, v0.3.4
atom-beautify, v0.29.10
atom-ctags, v4.5.2
atom-html-preview, v0.1.21
atom-svg-icon-snippets, v0.3.3
auto-detect-indentation, v1.1.0
autoclose-html, v0.23.0
autocomplete-awk, v0.1.2
autocomplete-html-entities, v0.1.0
autocomplete-js-import, v1.0.1
autocomplete-json, v5.1.0
code-peek, v1.4.8
emmet, v2.4.3
file-icons, v1.7.17
file-watcher, v0.4.0
font-viewer, v0.3.1
fonts-cjk, v0.1.2
highlight-selected, v0.11.2
jQuery, v1.2.4
language-svg, v0.9.0
linter, v1.11.14
linter-jshint, v2.1.0
linter-jsonlint, v1.3.0
linter-sass-lint, v1.6.1
minimap, v4.24.7
pigments, v0.31.2
project-manager, v2.9.7
semanticolor, v0.2.2
svg-preview, v0.7.4
terminal-plus, v0.14.5

# Dev
No dev packages

Support TypeScript React

Right now tsx aren't supported when they could be. Even better would be to support components peek

Peeking doesn't work in spec file

As part of #29 (PR #30) everything works but does not peek into spec files. Oracle PL/SQL code is usually defined in two files: pks (spec) and pkb (body).

"public" constants are defined in the pks file. code-peek doesn't seem to find their definitions in the spec file. Any idea why it doesn't work?

Update

Upon further analysis the code only looks at files of the same file type. In the case of languages that have the spec and body in separate files this may prevent the search from finding the files. For Oracle developers packages are usually named pkg_name.pks (spec) and pkg_name.pkb (body). In the body's code it will only search for other pkb files. This is not necessarily a bad thing but some times I want to search the spec file for global constants and types. This logic is in lib/code-peek.coffee in function constructPathsArray.

This also raises the question: Should we look through all the files with the same extension or use the package name as the search. For example in code is usually referenced as my_package.my_function. Why should I have Atom search through all the *.pkb files when I know that I can determine that it should search for my_function in a file that starts with my_package. This may improve search time as it is currently a bit slow.

Would the above proposal work for other languages as well?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.