I setup Neovim LSP using the nvim-lspconfig and the lsp-installer where I also installed the pyright server.
Without any further configuration it worked out of the box. However when I have a class in a subfolder and add a new method, pyright does not recognize this method when I want to access it in a different file. When I restart neovim, or open and close the file, pyright suddenly recognizes the newly added method.
I also tried :LspRestart with no effect.
I tried to add some settings to the pyright server:
return {
settings = {
python = {
analysis = {
autoSearchPaths = true,
diagnosticMode = "workspace",
useLibraryCodeForTypes = true,
}
}
},
}
But this also had no effect.
:LspLog also does not show anything which could point to the issue:
[START][2022-07-15 11:11:05] LSP logging initiated
[WARN][2022-07-15 11:11:09] ...lsp/handlers.lua:109 "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2022-07-15 11:11:09] ...lsp/handlers.lua:456 "stubPath typings is not a valid directory."
[WARN][2022-07-15 11:11:20] ...lsp/handlers.lua:109 "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"
I also could not find any setting regarding to this issue here which could solve this.
Since I am new to python, the way I import and structure classes might not be common and might be an issue which could cause this problem.
As a main entry point I have main.py in the root folder
All other source files are in a program/ folder which does not have a __init__.py
Inside program/ there are folders which each have a __init__.py file f.e. core/
core/__init__.py:
from .myClass import myClass
and in main.py I import it like this:
from subfolder.core import myClass
myClass.newMethod() # this is only recognized by lsp/pyright after the file is closed and reopen
Is the issue a bug in pyright (not likely I guess), a missing setting or my strange folder/import structure?
Can you try this: create (or modify) pyproject.toml, put it in the project root directory. Inside pyproject.toml, add the following lines:
[tool.pyright]
extraPaths = ["program/core" ,"program/directory_2", "program/directory_3"]
The idea is that you have to add the sub directories manually, which is really tedious but at least it works in my case.
I have install new Gitlab instalation on my Ubuntu server with Apache2 websrver. I created here (in web GUI) new repository like "testik.git" and I get http path:
http://git.domain.tld/testovic/testik.git
But, when I put this in git command on my winPC
git clone http://git.domain.tld/testovic/testik.git
Command return
Cloning into 'testik'...
fatal: unable to access 'http://git.domain.tld/testovic/testik.git/': Could not resolve host: git.domain.tldtestovic
I see unnecessary trailing slash in "fatal" information and I see too, that this slash is missing after "TLD" before "username".
And same problem is, when I open project in webGUI and click on leftside menu e.g. to "Security&Compliance" --> "Configuration" and in e.g. first part named "Static Application Securty Testing (SAST)" try to click on button "Configure with a merge request".
I have got error page with URL starting with
https://git.domain.tldtestovic/testik/-/merge_requests/new?merge_request....
I see here missing slash after TLD again ... when I put manually slash after TLD and press enter, everything is fully funtional.
Do you have somebody any good idea, any solution what to do with missing slash after TLD ? Where could be the problem?
I know, that this is not problem of DNS, because ping git.domain.tld is OK. I suppose, that something wrong need to be in configuration.
In \etc\gitlab\gitlab.rh I have done these manuall changes
external_url 'http://git.domain.tld'
gitlab_rails['trusted_proxies'] = ['<my Ubuntu serverIP>']
gitlab_rails['initial_root_password'] = "<some good password>"
gitlab_rails['db_adapter'] = "postgresql"
gitlab_rails['db_encodig'] = "unicode"
gitlab_rails['db_database'] = "<database name>"
gitlab_rails['db_username'] = "<some username>"
gitlab_rails['db_password'] = "<some another good password>"
gitlab_rails['db_host'] = "<correct address to the nonlocalhost DB server>"
gitlab_rails['db_port'] = 5432
gitlab_workhouse['listen_network'] = "tcp"
gitlab_workhouse['listen_addr'] = "127.0.0.1:8181"
postgresql['enable'] = false
web_server['external_users'] = ['www-data']
nginx['enable'] = false
nginx['redirect_http_to_https'] = true
I read a lot of post, pages, etc. But without success. Thank you very much for the way to functional git with Gitlab.
Whoops! We seem to have hit a snag. Please try again later.
Codeigniter 4 shows an error when I run the CI4 application, How I resolve?
Changes:
public $baseURL = 'http://ci.local';
public $baseURL = 'http://localhost:8080';
public $indexPage = '';
This work for me try it
Go to app directory then to boot directory you will see production.php file.
That is:
app => Config => Boot => production.php
Change the ini_set('display_errors', '0') to ini_set('display_errors', '1').
Warning: When in production change back to initial ini_set('display_errors', '0')
Or
you can rename your file env in your project directory to .env after that open it and edit.
Search for # CI_ENVIRONMENT = production remove # and change production to development
Warning: When in production change back to initial CI_ENVIRONMENT = development to CI_ENVIRONMENT = production
For those experiencing intl error go to where your php installation directory edit the php.ini file remove semi-colon ";" from ;extension=intl to extension=intl. save the file and restart your server. I think this will solve that error. This particular editing of my php.ini was on php 7.2 - 8.1 so I haven't check other version of php lesser than these versions which Codeigniter 4 does not support
After installing CodeIgniter 4 when you run the app then you will get an error like this
To know the error go to the app/Config/Boot/production.php and set display_errors to 1 as below
ini_set('display_errors', '1');
Now, you will see the actual error below
Nothing to worry about it. The app needs permission. Assign the permission like as below
sudo chmod -R 777 project_name
Assume that your root folder of your CI4 project is rootproject.
Edit rootproject/.env file.
On line 17 change from:
# CI_ENVIRONMENT = production
to:
CI_ENVIRONMENT = development
Save it.
Refresh your browser that pointing to your CI4 project.
It should give you many error messages.
If there is something written as CacheException, than your cache folders are not writable.
Make it writable;
Ubuntu:
chown -Rv www-data rootproject/writable
CentOS:
chown -Rv apache rootproject/writable
Easy way:
chmod 777 -Rv rootproject/writable
In your CI4 project root, create a file named .env. It should be in the same directory as system, app e.t.c
Then, add this CI_ENVIRONMENT = development
The problem is most likely due to missing extensions. Check server requirements here.. Check your php.ini file and make sure intl and mbstring are enabled.
I had the same problem, I have a simple solution for Mac.
- in the project folder, go to 'writable'
- select all the folders contained and click on 'get information'
- go share and permissions
- in 'everyone' select 'read and write'
That's it! refresh the page
Try This
Open [xampp]/php/php.ini
Search for ;extension=intl and remove the ;
Save the php.ini file and restart Apache(server).
In Root folder change: env to .env
Change # CI_ENVIRONMENT = production to CI_ENVIRONMENT = development (ensure it is uncommented)
Your error may be related to the knit.php file.
Go to System/Third Party and change: knit.php to Knit.php (Capital)
Reload.
For those using XAMPP in MacOS:
You don't need to change the ownership of the writable directory. You only need to change permission to entire directory:
chmod -R 777 writable
When you change # CI_ENVIRONMENT = production to CI_ENVIRONMENT = development don't forget of rename the env file to .env else it will not work.
You're running in the production environment and need to change it to a Development or Testing environment to see the error messages within the browser.
There are a few ways to do this, but adding:
SetEnv CI_ENVIRONMENT development
To the Apache httpd.config file is what worked for me.
_t
I got the answer for this query; just follow these steps:
From the command line, at your project root just hit this
php spark serve
Then hit this on your browser http://localhost:8080/
Enjoy your Latest CI.
Not sure what the desired answer is, but:
If you are asking to see what is the actual error is - either change
your environment to testing/development (as suggested so far) or you
can check your logs - writable/logs/log-.php
If you wish to solve the error, we will need more information, like have
you setup virtual hosts, have you change .htaccess file in public
folder, etc. Otherwise we will be most likely betting (I bet it's virtual hosts).
In any case, a copy of the displayed error (after changing evnironment) or log file will be useful.
You can check logs file on writable/logs find error information,
If your logs information like :
CRITICAL - 2020-04-19 17:44:55 --> Invalid file: template/header.php
#0 F:\xampp\htdocs\ppdb\vendor\codeigniter4\framework\system\View\View.php(224): CodeIgniter\Exceptions\FrameworkException::forInvalidFile('template/header...')
And go fix your error, in my case i am wrong typed name on controller file
In Codeigniter 4 source code have a folder named writable, just update it's access permission. Sometimes it'll help to get rid of Whoops. Also can check the video for Ubuntu / Linux
I am trying to sycronize an FTP folder with a local directory. This FTP server is running on z/OS, it's a mainframe with he MVS operating system.
So far I've had a lot of problems even to manage to connect to the folder I needed because this system doesn't have a "normal" folder system.
This is what I've done to change to the working directory where my files are:
public class DefaultFtpHostSessionFactory extends DefaultFtpSessionFactory {
protected void postProcessClientAfterConnect(FTPClient ftp) throws IOException {
ftp.changeToParentDirectory();
ftp.changeWorkingDirectory("E377D.");
}
}
Now I've defined an input-channel-adapter:
<int-ftp:inbound-channel-adapter
id="ljFtpInbound"
channel="ljFtpChannel"
session-factory="ljCachingSessionFactory"
auto-create-local-directory="true"
delete-remote-files="false"
filename-pattern="*"
remote-directory="*"
remote-file-separator=""
charset="UTF-8"
auto-startup="true"
preserve-timestamp="false"
local-filename-generator-expression="#this.toUpperCase()"
temporary-file-suffix=".writing"
local-directory="/tmp/">
<int:poller fixed-rate="1000" />
</int-ftp:inbound-channel-adapter>
As you can notice the remote directory is "*", that's for listing the directory, at least is the only way I've managed to do it.
But when FtpInboundFileSynchronizer tries to synchronize the folder I get an error because when it tries to copy the file the path is build with:
String remoteFilePath = remoteDirectoryPath + remoteFileSeparator + remoteFileName;
Which in my case would be "ASTERISK" + "BLANK" + "REMOTE_FILE_NAME", because I had to use "*" as the remote-directory, so it doesn't find the file.
¿Do you know if I can not to set the remote-directory (which I tried but didn't achieve)? Or there is another way to synchronized this weird FTP system.
Thank you.
How about this?
Starting with version 4.3, The remote-directory/remote-directory-expression attributes can be omitted assuming null. In this case, according to the FTP protocol, the Client working directory is used as a default remote directory.
That means you should try to upgrade to Spring Integration 4.3 and remove that strange * at all.
I want to create a link from my webapp to a directory on the server.
I'm using the following code:
java.nio.file.Path link = Paths.get(dirInMyApp);
java.nio.file.Path target = Paths.get(dirOnTheServer);
Files.createSymbolicLink(link, target);
This works, but seems to have a strange side effect: If "dirOnTheServer" had files in it, it will be empty after the link is created!
Also, I can use the link from my app and add files to the "dirOnTheServer" directory, but if I redeploy my app, it's empty again.
Actually createSymbolicLink does not empty the directory - undeploying a webapp from tomcat with such links will.
This can be prevented by deleting the link when the webapp is being undeployed.