Skip to content

Intellisense not working in angular project #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexbjorlig opened this issue Aug 20, 2020 · 9 comments
Closed

Intellisense not working in angular project #172

alexbjorlig opened this issue Aug 20, 2020 · 9 comments

Comments

@alexbjorlig
Copy link
Contributor

Trying to setup tailwind with our Angular project, and it does not work 🤔

tailwind.config.js

module.exports = { theme: { extend: {} }, variants: {}, plugins: [] };

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.scss$/,
        loader: 'postcss-loader',
        options: {
          ident: 'postcss',
          syntax: 'postcss-scss',
          plugins: () => [
            require('postcss-import'),
            require('tailwindcss')('./tailwind.config.js'),
            require('autoprefixer'),
          ]
        }
      }
    ]
  }
};

package.json

"devDependencies": {
        "tailwindcss": "^1.6.2"
    },

I followed the troubleshooting steps from the readme, but no help. Is there somewhere we can trace logs/issues?

@bradlc
Copy link
Contributor

bradlc commented Aug 25, 2020

Hey @alexbjorlig. Do you see any errors in the Output panel? You can open this from the command palette or press cmd+shift+u if you're on macOS. (You'll need to select tailwindcss-intellisense from the dropdown)

Also are you able to share your project at all? If not could you provide some details such as package manager (npm, yarn etc.), operating system, VS Code version, general project structure?

@alexbjorlig
Copy link
Contributor Author

I don't see the extension at all in the Output panel?

Screenshot 2020-08-25 at 20 08 36

And it is installed?

Screenshot 2020-08-25 at 20 09 27

Some details:

npm: 6.14.7
node: v14.8.0
OS: macOS Catalina 10.15.6 (19G73)
VS Code Version: 1.48.2
General project structure: Angular CLI project

@alexbjorlig
Copy link
Contributor Author

I just tried to verify if the extension would work in a "clean" Angular CLI environment - and indeed it does. How can I proceed from here? If I buy you a beer - would you mind take a quick look at our project, or do you know if I can get some error output somehow?

@bradlc
Copy link
Contributor

bradlc commented Aug 25, 2020

Happy to take a look if you can share a repository! If it's not in the Output panel that means the language server hasn't booted. I should have said: you need to open a supported file type (e.g. a HTML file) to boot the server

@alexbjorlig
Copy link
Contributor Author

It's a private repository, but we could create a zoom meeting maybe? Otherwise, I have to make the famous reproducible example 😂

I don't get any output, even when opening an HTML file.

@alexbjorlig
Copy link
Contributor Author

alexbjorlig commented Aug 26, 2020

@bradlc I invited you to a copy of the project, with a description in the README.md on how to proceed. Let me know if there are any other things I can try?

@bradlc
Copy link
Contributor

bradlc commented Aug 26, 2020

Thanks @alexbjorlig! I have found the issue: the extension activates only when certain files exist in the workspace. The .vscode/settings.json file in your project is preventing VS Code from finding the Tailwind config file:

"search.exclude": {
  "**/*.js": true
}

@alexbjorlig
Copy link
Contributor Author

Ahh amazing work @bradlc ! Should I add a PR with this to the README.md, or is there anything else I could help contribute to?

@bradlc
Copy link
Contributor

bradlc commented Aug 26, 2020

I think it would be good to add a note to the "Troubleshooting" section maybe? Something along the lines of making sure that your VS Code settings aren't causing the Tailwind config to be excluded from search. If you don't get chance I will add it later this week so don't worry about it 👍

@bradlc bradlc closed this as completed Aug 26, 2020
alexbjorlig added a commit to alexbjorlig/tailwindcss-intellisense that referenced this issue Aug 26, 2020
In refrence to issue tailwindlabs#172, this VS code setting:
```
"search.exclude": {
    "**/*.js": true
},
```
prevented the Tailwind config from being found ☺️
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants