On Eclipse, what does “Preferences -> General -> Workspace -> Refresh using native hooks or polling” do?

前端 未结 3 1149
梦谈多话
梦谈多话 2020-12-30 05:21

There is this check box on Eclipse:

Preferences -> General -> Workspace -> Refresh using native hooks or polling

The Eclipse documentation says:

相关标签:
3条回答
  • 2020-12-30 05:48

    I have found out that the option "Refresh using native hooks or polling" was the original way of doing this:

    Previous Eclipse versions relied on native refresh providers (on Windows) or a polling mechanism to keep the workspace synchronized with the underlying filesystem. This capability can be still enabled by selecting Refresh using native hooks or polling on Opens the preference page Preferences > General > Workspace.

    Now a new lightweight mechanism is available. Files discovered to be out-of-sync by the workspace, for example while accessing the file content by an editor, will be automatically asynchronously refreshed. If you want to refresh files this way, go to Opens the preference page Preferences > General > Workspace and select Refresh on access.

    From now on I'll go only with Refresh on access.

    0 讨论(0)
  • 2020-12-30 05:51

    Yes, this is really what Eclipse is doing. For Mac or Linux it currently uses polling.

    There is an extension point org.eclipse.core.resources.refreshProviders that can be used to provide the refresh code for each platform and people have written test plugins for Mac and Linux but they are not in the product (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=108697 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=237344 )

    Source for this is org.eclipse.core.internal.refresh.MonitorManager, PollingMonitor does the polling refresh.

    org.eclipse.core.internal.resources.refresh.win32.Win32RefreshProvider does the Windows refresh using native methods via JNI (it is in a Windows only plugin).

    org.eclipse.core.internal.resources.refresh.win32.Win32Monitor and Win32Natives contain the core code.

    0 讨论(0)
  • 2020-12-30 05:55

    "Refresh using native hooks or polling" can solve the problem about project building is not updated when files are edited using external editors. problem details

    0 讨论(0)
提交回复
热议问题