Giter VIP home page Giter VIP logo

atom-react-autocomplete's People

Contributors

davidwells avatar stefanpahlplatz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

atom-react-autocomplete's Issues

error on generation if you don't npm run generate first

After I cloned, instead of generating the react-toolbox completions, I went straight for material-ui that I had elsewhere. This was the output:

node generate-completions.js --src ~/Projects/test/node_modules/material-ui/**/*.js
React Doc Gen Finished. Build Tokens
fs.js:585
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/Users/name/.atom/packages/react-proptype-autocomplete/react-doc-gen-output.json'
    at Error (native)
    at Object.fs.openSync (fs.js:585:18)
    at Object.fs.readFileSync (fs.js:432:33)
    at generateCompletions (/Users/name/.atom/packages/react-proptype-autocomplete/parse-docgen.js:11:33)
    at /Users/name/.atom/packages/react-proptype-autocomplete/generate-completions.js:19:3
    at ChildProcess.exithandler (child_process.js:221:5)
    at emitTwo (events.js:88:13)
    at ChildProcess.emit (events.js:173:7)
    at maybeClose (internal/child_process.js:819:16)
    at Socket.<anonymous> (internal/child_process.js:320:11)

If I ran npm run generate first, and then run as above, it seems to work ok.

enhancement: parse additional proptypes from other components

I have a Wrapper component that wraps another component and needs to expose its propTypes up the chain, so I was trying something like this:

TextInput.propTypes = { ...WrappedComponent.propTypes }

I would love for this to be able to inherit these propTypes from the related component

Not matching `hasTagScope`

I haven't dug into how this works too much but it's not matching me in a jsx file when I type:

  renderThing() {
    return <MyComp[CURSOR_HERE]
  }

I can see the check at:

  hasTagScope: function(scopes) {
    return scopes.indexOf('meta.tag.any.html') !== -1
    || scopes.indexOf('meta.tag.other.html') !== -1
    || scopes.indexOf('meta.tag.block.any.html') !== -1
    || scopes.indexOf('meta.tag.inline.any.html') !== -1
    || scopes.indexOf('meta.tag.jsx') !== -1
    || scopes.indexOf('meta.tag.structure.any.html') !== -1;
  },

but my current scopes are:

"source.js.jsx"
"meta.block.es"
"meta.block.es"
"variable.other.readwrite.js"

would this have something to do with other packages installed?

Add enum autocompletion

autocomplete values for PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'danger']) after prop is selected

Error on generate

EDIT: Repeated the same steps, but the problem is no longer there. I have no idea as to why, though.

I followed the steps of the readme, but I can't get the rc-autocomplete generate command to work. Running it results in:

React Doc Gen Finished. Build Tokens
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);^

Error: ENOENT: no such file or directory, open '/Users/joep/Dev/my_project/node_modules/react-autocomplete-cli/react-doc-gen-output.js
on'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at generateCompletions (/Users/joep/Dev/my_project/node_modules/react-autocomplete-cli/parse-docgen.js:14:33)
    at /Users/joep/Dev/my_project/node_modules/react-autocomplete-cli/generate-completions.js:31:3

    at ChildProcess.exithandler (child_process.js:209:5)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "rc-autocomplete"
npm ERR! node v5.10.1
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] rc-autocomplete: `rc-autocomplete`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] rc-autocomplete script 'rc-autocomplete'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rc-autocomplete

My importjs.json:

{ "lookupPaths": [ "node_modules/**/*.js", "app/components" ] }

I'm running Atom 1.10.2 on MacOS 10.12.1 (Beta).

Perhaps I'm doing something wrong, or some library in my project is not fully compatible.

Thanks for the hard work, by the way! This is exactly the tool that I wanted :)

Error On Generate

I followed the repo's README steps, and even collaborated with the README from the cli package, as well as checking the code itself to complete the step of generating the completions, but it seems I'm doing everything correctly, but the generator craps out when running the parse-docgen's generateCompletions function, and it seems that it has issues with trying to open the file it's suppose to spit out.

Of course seeing fs errors always make me worry that it's platform independent as well, as packages like fsevents require OSX (and it never fails to remind me). Anyways...

The RAC CLI is version 0.0.3.
I'm using a Xbuntu 16.04 (Ubuntu Vivid Core)
While it doesn't pertain to this issue, I'm also using Atom 1.10.2

Here's the error:

`React Doc Gen Finished. Build Tokens
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^ (under the 'o' in '.open')

Error: ENOENT: no such file or directory, open '/home/dbrown/Development/barista-core/node_modules/react-autocomplete
-cli/react-doc-gen-output.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at generateCompletions (/home/dbrown/Development/barista-core/node_modules/react-autocomplete-cli/parse-docgen.js
:14:33)
at /home/dbrown/Development/barista-core/node_modules/react-autocomplete-cli/generate-completions.js:31:3
at ChildProcess.exithandler (child_process.js:213:5)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)`

Failed to activate the atom-react-autocomplete package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.9.8
System: Mac OS X 10.11.6
Thrown From: atom-react-autocomplete package, v0.1.10

Stack Trace

Failed to activate the atom-react-autocomplete package

At Cannot read property 'path' of null

TypeError: Cannot read property 'path' of null
    at currentFilePath (/Users/stoebelj/.atom/packages/atom-react-autocomplete/lib/getCurrentPath.js:7:58)
    at Object.module.exports.loadCompletions (/Users/stoebelj/.atom/packages/atom-react-autocomplete/lib/provider.js:309:15)
    at Object.module.exports.activate (/Users/stoebelj/.atom/packages/atom-react-autocomplete/lib/main.js:8:21)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:183:20)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:156:32
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:149:26
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:146:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:538:21)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:519:29
    at Config.module.exports.Config.transactAsync (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:337:18)
    at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:514:19)
    at PackageManager.module.exports.PackageManager.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:497:46)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:760:28

Commands

Config

{
  "core": {
    "packagesWithKeymapsDisabled": []
  }
}

Installed Packages

# User
atom-beautify, v0.29.10 (inactive)
atom-react-autocomplete, v0.1.10 (inactive)
atom-react-native-autocomplete, v0.0.27 (inactive)
atom-wrap-in-tag, v0.6.0 (inactive)
erb-snippets, v1.1.0 (inactive)
git-diff-details, v1.3.0 (inactive)
highlight-selected, v0.11.2 (inactive)
language-javascript-jsx, v0.3.7 (inactive)
react, v0.15.0 (inactive)
remote-atom, v1.3.9 (inactive)
split-diff, v1.0.3 (inactive)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.51.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.43.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.3.2 (inactive)
one-light-ui, v1.3.2 (inactive)
one-dark-syntax, v1.2.0 (inactive)
one-light-syntax, v1.2.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.2 (inactive)
archive-view, v0.61.1 (inactive)
autocomplete-atom-api, v0.10.0 (inactive)
autocomplete-css, v0.11.1 (inactive)
autocomplete-html, v0.7.2 (inactive)
autocomplete-plus, v2.31.0 (inactive)
autocomplete-snippets, v1.11.0 (inactive)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (inactive)
background-tips, v0.26.0 (inactive)
bookmarks, v0.41.0 (inactive)
bracket-matcher, v0.82.1 (inactive)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (inactive)
dev-live-reload, v0.47.0 (inactive)
encoding-selector, v0.22.0 (inactive)
exception-reporting, v0.39.0 (inactive)
fuzzy-finder, v1.3.0 (inactive)
git-diff, v1.1.0 (inactive)
find-and-replace, v0.198.0 (inactive)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (inactive)
image-view, v0.58.0 (inactive)
incompatible-packages, v0.26.1 (inactive)
keybinding-resolver, v0.35.0 (inactive)
line-ending-selector, v0.5.0 (inactive)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (inactive)
metrics, v0.53.1 (inactive)
notifications, v0.64.1 (inactive)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.238.2 (inactive)
snippets, v1.0.2 (inactive)
spell-check, v0.67.1 (inactive)
status-bar, v1.4.1 (inactive)
styleguide, v0.46.0 (inactive)
symbols-view, v0.113.0 (inactive)
tabs, v0.98.1 (inactive)
timecop, v0.33.1 (inactive)
tree-view, v0.208.0 (inactive)
update-package-dependencies, v0.10.0 (inactive)
welcome, v0.34.0 (inactive)
whitespace, v0.32.2 (inactive)
wrap-guide, v0.38.1 (inactive)
language-c, v0.52.1 (inactive)
language-clojure, v0.21.0 (inactive)
language-coffee-script, v0.47.0 (inactive)
language-csharp, v0.12.1 (inactive)
language-css, v0.36.2 (inactive)
language-gfm, v0.86.0 (inactive)
language-git, v0.13.0 (inactive)
language-go, v0.42.0 (inactive)
language-html, v0.44.1 (inactive)
language-hyperlink, v0.16.0 (inactive)
language-java, v0.22.0 (inactive)
language-javascript, v0.119.0 (inactive)
language-json, v0.18.0 (inactive)
language-less, v0.29.3 (inactive)
language-make, v0.22.2 (inactive)
language-mustache, v0.13.0 (inactive)
language-objective-c, v0.15.1 (inactive)
language-perl, v0.35.0 (inactive)
language-php, v0.37.0 (inactive)
language-property-list, v0.8.0 (inactive)
language-python, v0.45.0 (inactive)
language-ruby, v0.68.5 (inactive)
language-ruby-on-rails, v0.25.0 (inactive)
language-sass, v0.52.0 (inactive)
language-shellscript, v0.22.3 (inactive)
language-source, v0.9.0 (inactive)
language-sql, v0.21.1 (inactive)
language-text, v0.7.1 (inactive)
language-todo, v0.28.0 (inactive)
language-toml, v0.18.0 (inactive)
language-xml, v0.34.8 (inactive)
language-yaml, v0.26.0 (inactive)

# Dev
No dev packages

Typescript support

is typescript .tsx supported? i tried the following..

.importjs.json

{
  "lookupPaths": [
    "testing/**/*.tsx"
  ]
}

and the generated completions.json looks like this..

{
  "components": {
    "description": {},
    "methods": {}
  }
}

i have one component called test-component.tsx inside a directory called testing that looks like this...

import * as React from 'react';

interface TestComponentProps {
    test : string;
}

const TestComponent : React.StatelessComponent<TestComponentProps> = ( props : TestComponentProps ) => {
    return (
        <div>{ props.test }</div>
    );
};

export { TestComponent as default };

should this work?

Handle Component Name Collisions

If you include 2 libraries with the same component names the completions.json will only include one.

Example: if your project has a Button component and a third party library also has Button only one will be in autocompletions

Components will need to be name_spaced to avoid these collisions

Uncaught SyntaxError: Unexpected token # in JSON at position 0

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.28.1 x64
Electron: 2.0.4
OS: Microsoft Windows 10 Pro
Thrown From: atom-react-autocomplete package 0.1.10

Stack Trace

Uncaught SyntaxError: Unexpected token # in JSON at position 0

At file:///C:/Users/thedung/AppData/Local/atom/app-1.28.1/resources/app.asar/static/index.html:1

SyntaxError: Unexpected token # in JSON at position 0
    at JSON.parse (<anonymous>)
    at /packages/atom-react-autocomplete/lib/provider.js:321:40
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

Commands

Non-Core Packages

atom-beautify 0.32.5 
atom-react-autocomplete 0.1.10 
atom-react-native-style 0.2.0 
atom-ternjs 0.18.3 
atom-yarn 0.9.0 
autocomplete-modules 2.0.0 
busy-signal 1.4.3 
git-plus 7.10.2 
intentions 1.1.5 
language-babel 2.85.0 
linter 2.0.0 
linter-eslint 8.4.1 
linter-ui-default 1.7.1 
react-es6-snippets 0.3.0 
react-native-components 0.1.1 
react-snippets 1.1.0 

Suggestion/Feedback: Minor Changes to Help with Install

I've been through so many auto-completion plugins in the past year for React/JSX, and when I see a new one like this, which offers what it does, and helps replace the React plugin (which offers a bunch of functionality in one package, causes conflicts with many others, and doesn't always work), I'm always for trying to help out by spreading the word, and giving feedback. If you are all open to feedback, I thought of a few minor suggestions to help you with your install, and at least get users using your plugin right away, and bask in the awesomeness (from what I've seen).

1. First off, I love that you are adding auto-complete for everything in the project, but does it have to happen when starting out? Could new users have a default completions.json to work with, and have the option to add imports, and other project specific options later?

1a. If you were to create a default completions.json, this could even be something that lived with the Atom package, and project-based completions (node_modules, src), could be added to the project directory's completions file (similar to atom-ternjs).

3. When generating the completions, why can't the cli be installed with the atom package, and referenced there? You almost always know where an atom config dir is going to be, and if someone uses a custom directory, give them a package variable as an option in the package settings so that they can point the package to that location.

4. Lastly, why not have a generate command within Atom? I'm sure this is probably something planned for the future as well, but even using some automation through a install of the pty.js library, or something like that allowing you to automate and still use a shell.

I hope you do not take these as insults, or attacks of any kind at all, as they were certainly not written to be portrayed as such. I would really like to see this project become more user-friendly, and reach the masses. I simply wanted to leave these suggestions, because I know that an outside view can sometimes be very helpful when focusing on a certain model for so long. Who knows, these might already be ideas on the back-burner, but I at least wanted to give you some feedback from the other side of the fence. :)

can't find json(react-doc-gen-output.json) file

-----------error----------
no such file or directory, open 'D:\atomworkspace\bdzbapp\node_modules\react-autocomplete-cli\react-doc-gen-output.json'
-----------error----------

windows Env,can't find json file.when run "npm run generate"

It doesn’t work ...

It's a great idea but for me it doesn’t work and I can’t figure out why not.

I’m on:

Atom 1.13.0 x64 on macOS Sierra 10.12.2
https://atom.io/packages/react 0.16.2
https://atom.io/packages/atom-react-autocomplete 0.1.10

.importjs.json contains

{
    "lookupPaths": [
        "view-components/src/component"
    ]
}

completions.json contains for example:

{
  "components": {
    "battery-level.jsx": {
      "attributes": [
        "percentage"
      ],
      "props": {
        "percentage": {
          "type": {
            "name": "number"
          },
          "required": false,
          "description": "",
          "defaultValue": {
            "value": "100",
            "computed": false
          }
        }
      }
    },
    ...

package.json contains

{
  "scripts": {
    "generate": "rc-autocomplete"

and the command
npm run generate
works

Atom was restarted after the installation of the package but the atom-react-autocomplete neither autocompletes the names of the components nor the properties of the components.

It would be nice if atom-react-autocomplete had some debugging options or if it was a bit more verbose on why it wouldn’t work.

no prop type

I have a component AuthModal that has a prop modalStatus of type string, and the "string" part isn't showing on autocomplete (see screenshot below)

I'm using flow:

// AuthModal.jsx
type Props = {
  modalStatus: string,
  onModalOverlayClick: Function,
  onGoToLoginClick: Function,
  onGoToSignupClick: Function,
  onGoToForgotPasswordClick: Function,
  onLogin: Function,
  onSignup: Function,
  onCloseModal: Function,
  onLostPassword: Function,
  onGoToYearlyPaymentClick: Function,
  onGoToLifetimePaymentClick: Function,
  onTogglePaymentModeClick: Function,
};

versions:

$ apm -v
apm  1.16.1
npm  3.10.5
node 6.9.5 x64
python 2.7.12
git 2.7.4

let me know if there's anything else I should post here

image

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.